Deprecate 'changed' and introduce new store update signal
When I built the first version of Rodux, the best way to respond to changes outside of something like React/Roact wasn't very well understood.
I think that we understand now that the best way to respond to changes in the Rodux store is to keep the last value you had, and on update, compare the new store state with it. In short, you should ignore the second argument of the changed event!
This issue covers two gripes:
- I want to remove the second value passed by the
changedsignal because it's a bad practice - I want to fix the naming of the changed signal to indicate that it's a signal (
onUpdatemaybe?)
We could also (re)introduce the old subscription approach, a method called subscribe that returns a disconnection function. This might be the simplest approach, and avoids requiring an additional API (a signal object).
Subscriptions seem like a more intuitive mindset to the places I use .changed for.