v2 does not work with redux-observable
See original GitHub issueDescribe the bug
This is a separate ticket to highlight the second issue I was having with V2 and redux-observable
briefly mentioned in #260 . The issue I was having, was that for some reason I had to re-arrange my enhancer and middleware, otherwise my dispatched actions from the main process weren’t picked up by the renderer process. I am not sure if this should be documented or resolved.
This change is related to the API change to remove replayActionRenderer
. Listening for and dispatching actions from the middleware instead of after the createStore has been created, like the V1 api, is causing the dispatched actions to not get picked up by the middleware. The renderer process is receiving an action, the reducer are being called because of it, but not the middleware. I think it is because when the enhancer is after the middleware in the compose function, the dispatch
in the enhancer isn’t setup yet with the middleware.
I see 3 solutions here. Re-introduce replayActionRenderer
, ~document the necessity to have the enhancer as the first item~, or fix it somehow inside the enhancer itself so that the simple API remains and the compose order is not so error-prone. But I am not sure if this is possible.
To Reproduce I may be able to provide a sample project if needed, but it will take some effort to set up.
My setup: Main process -> some action -> epic middleware -> action -> dispatched to renderer -> middleware not triggered (neither redux-logger or redux-observable)
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (4 by maintainers)
Top GitHub Comments
@matmalkowski No, indeed, that may have been over exaggerated, wasn’t sure yet 1 hour ago if more changes were needed. Will send a PR your way as soon as I get things cleaned up. 🙂
@Slapbox I will just create a PR to this repo as soon as I am happy with it. No need to start yet another fork. That repo is just to create a PR from.
With the above approach,
replayActionRenderer
will not need to be introduced. Something extra will just be introduced to replace the current enhancer.And no, I just removed those hacks while now preparing these changes, so I will not be able to share these anymore.