-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Hot Reload Saga Support #391
Comments
I took a quick stab at this and it failed. Here's my code that I was playing with in console.log('HOT', module.hot)
// hot-reload Redux store
if (__DEV__ && module.hot) {
module.hot.accept(['./', './TemperatureRedux', './LoginRedux'], () => {
const nextRootReducer = combineReducers({
temperature: require('./TemperatureRedux').reducer,
login: require('./LoginRedux').reducer
})
store.replaceReducer(nextRootReducer)
})
} Noticed hot module replacement always works after the first error message is displayed. Bonus docs: https://webpack.github.io/docs/hot-module-replacement.html |
now that I know editing a saga file twice makes hot-reloading work... I'm less inclined to figure this out, lol. No clue on how that works. |
Are there any updates on this? I just want to confirm that with the current version, there's no way to Hot Reload any saga code, correct? Unfortunately, that saving-it-twice trick doesn't seem to work for me. |
Hot reloading sagas is app-dependant. Sagas maintain their state and interrupting them may or may not make sense for all apps. Have a look at task cancellation in sagas for more details. Reducers on the other hand can be reloaded! |
As mentioned in the hot-reloading ticket, we should have support at the Provider level, so sagas and redux can be hot-reloaded. To be done by whomever gets there first!
Visual part was done at #155
References:
https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/redux/create.js#L28-L32
http://stackoverflow.com/questions/34243684/make-redux-reducers-and-other-non-components-hot-loadable
The text was updated successfully, but these errors were encountered: