Making Found react to Farce push/replace actionsSee original GitHub issue
I set up Found using the
createConnectedRouter way. When I dispatch
replace actions from Farce, I see that they’re dispatched, but the reducer state doesn’t change and as a result I’m not redirected to the target location.
Is there anything obvious that I missed in the config? Basically I need a way to redirect the user from within my action creators.
- Created 6 years ago
- Comments:15 (6 by maintainers)
Top GitHub Comments
Going to close this out for now – this seems like a Redux limitation with a few decent enough workarounds, and I don’t want to constrain the API by making these be strictly middlewares.
It gets used by the rest of Found to pass methods around from the store.
Take a look at the code snippet I have above. There’s no necessary or technical reason why middlewares can’t dispatch upstream to enhancers.
You can also see that the core of both Farce and Found does sit in middlewares, so we could rejigger the API to expose the middlewares more directly. However, I don’t think I can get around the requirement of having to stick some methods onto the store, to allow e.g. the pattern where you just set up a
<Provider> and pass everything around on the store object, without exposing users to potential bugs in case they install a middleware or enhancer before the Farce/Found middlewares that make actions async, or something.