Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate 'changed' and introduce new store update signal #30

Open
LPGhatguy opened this issue May 22, 2018 · 2 comments
Open

Deprecate 'changed' and introduce new store update signal #30

LPGhatguy opened this issue May 22, 2018 · 2 comments
Milestone

Comments

@LPGhatguy
Copy link
Contributor

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 changed signal because it's a bad practice
  • I want to fix the naming of the changed signal to indicate that it's a signal (onUpdate maybe?)
@LPGhatguy LPGhatguy added this to the 1.0 milestone May 22, 2018
@LPGhatguy
Copy link
Contributor Author

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).

@Kampfkarren
Copy link

Subscriptions seem like a more intuitive mindset to the places I use .changed for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants