REEEEE
Reactivity in store
No problem
It's mentioned here a bit on the new docs for general reactivity:
https://docs.solidjs.com/concepts/intro-to-reactivity
But the tutorial on the main site might be more beneficial
18 replies
Reactivity in store
This will work because the property is read inside a function (the object getter) but when you do
It will call the
name
getter and only give you the value it was at that moment and won't react to changes to store.name
18 replies
Reactivity in store
The solution I would go with is to pass the store to the context instead if you need all the values. Otherwise you can use object getters but you won't be able to destructure the context like you've done. Or make functions to get specific properties from the store
18 replies
Reactivity in store
as for why the signal works, if you're simply passing the signal along via
value={{signalValue, changeName(){}}}
and reading it as
then that will work just fine because the signal is called in a place where reactivity is preserved, the jsx.
If you did this though, value={{...signalValue(), changeName(){}}}
, this wouldn't work because you're assigning the values to the value
prop and the value
prop isn't reactive18 replies
Reactivity issues with array items
But anyway, as for stores, whatever you read is tracked. So in this case, since you're reading waypoint in
containsWithWaypoints
, it will be tracked. If you want another property to be tracked, you'll have to read it in the loop somewhere10 replies