Objects containing reactive number properties only add or subtract values using special syntax
neghi14 opened this issue · comments
Describe the bug
Hi, I was testing out the reactive variables and I ran into an issue.
when working with the store, having a number property on it only seems to be reactive with selective syntax
To Reproduce
Steps to reproduce the behavior:
1.Create a Store
export const counter = {};
2. assign properties in the store. make them reactive and make one a number
property.
export const counter = { $count: 0, };
3. Import into component and create increment function like below
function Inc() { return counter.$count++; }
5.This function declaration does not cause a rerender, thus is not reactive although writing said function like this
function Inc() { return counter.$count+=1; }
seems to work great.
Expected behavior
Expected an update of value irrespective of coding style.
Desktop (please complete the following information):
- OS: Windows]
- Browser [Chrome]
- Version [116.0.5845.188]
Additional context
tried the same code on svelte and it worked as expected.
Thank you for the report! Looking in to it!