-
Notifications
You must be signed in to change notification settings - Fork 2
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
Declaratively subscribe method proposal... #1
Comments
The problem with subscribes is, that if you forget to unsubscribe or there's a bug skipping unsubscribe, you'll get memory leaks really easily.. |
Fair enough. |
I usually have a separate client-side API, which I use to change the app state. Then I'll do a single update for the whole app in a requestAnimationFrame throttle so that there's only one update per animation frame. In addition to that, there might be some separate temporary component state, but I try to avoid that. |
I should create an example app with RE:DOM to show how I personally use RE:DOM 😎 |
Currently I don't actually even use state = {
...state,
changedProperty: changedValue
} 😄 |
How are you passing that state data to your various components? |
With |
and |
Yes, make sense. Thats what I was thinking with some kind of redux like subscribe |
Perhaps an example of how you use state with re:dom would be good :) |
agreed 😅 |
What do you think about having a
subscribe
method that accepts a callback. Maybe even a parameter to specify what it should listen to. Could be a nice way to declaratively use in re:dom.i.e
What do you think?
The text was updated successfully, but these errors were encountered: