-
Notifications
You must be signed in to change notification settings - Fork 32
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
Delay slice()ing the listeneres #8
Comments
Thanks for the heads up. Was just looking over the redux release log an these look like the major changes: reduxjs/redux@b7031ce I wonder if I can avoid duplicating this logic by wrapping the listener callback instead of reimplementing the subscribe logic. |
Give it a try, let me know if there’s something I can do on our side |
So I ended up implementing both. Not sure if wrapping the listener ends up simplifying things, still end up needing all the tests as a regression. Direct port of redux core: 4093d5c One idea on the redux side that could help is moving the subscription logic into a util function this library could consume: tappleby/redux@6ca7c8d |
Mind publishing this emitter on npm? |
I can, though does it make sense as a standalone package? Also there's a bunch of emitters already on npm, wonder if it should be scoped to redux. eg redux-emitter or redux-core-emitter. |
So I merged the direct port (4093d5c) and released with v0.1.5. Wasnt sure the timeline for reduxjs/redux#1702, plus these optimizations will still be useful for non redux v4 users. |
👍 |
Redux introduced a few optimizations in 3.x, and we now delay
slice()
ing listeners unless absolutely necessary, and don’tslice()
them more than once perdispatch()
. This project should probably adopt similar optimizations.The text was updated successfully, but these errors were encountered: