-
Notifications
You must be signed in to change notification settings - Fork 23
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
redux-thunk compatibility #9
Comments
I just created a fork of this project that does things a bit differently and allows for use with thunk middleware (but you have to manually pass in the multireducerKey when using thunks so not amazing). It also changes the semantics of the project a bit to be closer to connect() and bindActionCreators(), and allows for multiple mountpoints. I needed this for a project I'm working on. Here is the link: https://github.com/adailey14/multireducer @erikras please take a look and let me know if you'd like me to make a pull request or anything. I haven't contributed to much open source on github so you'll have to let me know exactly how to do that. This would break backwards-compatability for the repo though so maybe you won't want to. |
Looks nice. I manage to solve my problem without multi reducer (by making reducer class) but your solution is much cleaner than mine. I'll probably try to use it in my next project. |
Thanks @jmarceli. I just did a bit of a rewrite and figured out how to make thunks work with no extra effort, which is so much better. The trick was taking over dispatch so that it wraps any dispatched actions with the multireducerKey, and wraps any 'thunk' action creators inside another thunk that passes them the modified dispatch. @erikras let me know when you have a chance to check it out - we could probably make it backwards compatible without too much effort and merge it back into this repo if you want to. |
|
Same issue here, did @adailey14 do a PR for this ? |
Sorry, i never did a PR. I am using that project fork for a personal project, and I think it probably diverged too much from this to do a clean PR. Feel free to jump into that code and put together a PR if you're so inclined! |
Hi guys. Can you pls check example of usage (http://localhost:3000/countersPage) and we can discuss API Cheers |
I hate a be a plus-oner, but this would be incredibly useful. Setting this up with redux-thunk or redux-actions as middleware is essential |
I'd be willing to accept a PR, but I don't have the time to code it myself. |
submitted PR #103 |
👍 |
For regular redux reducer action I can return a function. Example:
Is it possible also with multireducer? How?
I've tried code above but with no luck. Returned function was never executed.
The text was updated successfully, but these errors were encountered: