How to hot reload a store with a different middleware?
See original GitHub issueI have a DI container which I’m injecting into redux-thunk using the withExtraArgument
method.
When I’m hot reloading I need to recreate the DI, which means I need to replace the argument I’m passing the middlware or simply replace all middleware definitions, but I can’t think of any way to do it without recreating the entire store, which causes the following error to be thrown <Provider> does not support changing 'store' on the fly.
Is there a builtin way to do such a thing? or if not, what approach can you recommend for implementing such feature?
I’m using redux 3.6, react-redux 5.0.1 and react-hot-loader 3.0.0-beta.6
P.S. I hope this was the right repository to open this issue, if not let me know where should I have opened it. Thanks
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Reloading rails middleware without restarting the server in ...
Make use of auto-reloading, but make sure that the running rails instance and the already initialized middleware object keep "forgetting" ...
Read more >Building a Live Reload Middleware Component for ASP.NET ...
Live Reload works by having a FileWatcher on the server that is created as part of the middleware instantiation. When the middleware is...
Read more >Live Reload / Hot Module Replacement with Webpack ...
When using webpack-dev-middleware you don't get hot module replacement for free like you do with the webpack dev server. This is because the ......
Read more >Enabling hot reload in React web app | by Dong Chen - Medium
Hot reload allows developers to see result of code change in browser without page ... webpack-hot-middleware: notify browser when a new bundle is...
Read more >Configuring Your Store | Redux
A middleware which logs dispatched actions and the resulting new state. ... We'll add hot reloading both to our Redux reducers and to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a bug tracker, not a support system. For usage questions, please use Stack Overflow or Reactiflux. Thanks!
This would actually belong in the redux repo. That being said…
I’ve got some ideas on how to make all store enhancers hot-reloadable, as part of the store enhancer overhaul goal, but I’m not ready to share the details quite yet.