-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
Webpack works with module.hot
variables in modules. See: https://webpack.github.io/docs/hot-module-replacement.html
Having such variables would make some things seriously easier.
For Redux for example, the code in the following gist: https://gist.github.com/peteruithoven/59f188bfab035ce96948
Could turn into something like:
import {createStore} from 'redux';
import reducer from './reducers/index.js'
import { rehydrate, rehydratingStore } from './utils/rehydratingStore.js';
let initialState;
if(__hot) {
initialState = __hot.deletedModule;
}
const store = rehydratingStore()(createStore)(reducer, initialState);
Would it be possible to "inject" such variables into hot reloaded modules?
Metadata
Metadata
Assignees
Labels
No labels