MCPcopy
hub / github.com/reduxjs/redux / configureStore

Function configureStore

examples/universal/common/store/configureStore.js:5–20  ·  view source on GitHub ↗
(preloadedState)

Source from the content-addressed store, hash-verified

3import rootReducer from '../reducers'
4
5const configureStore = (preloadedState) => {
6 const store = createStore(
7 rootReducer,
8 preloadedState,
9 applyMiddleware(thunk)
10 )
11
12 if (module.hot) {
13 // Enable Webpack hot module replacement for reducers
14 module.hot.accept('../reducers', () => {
15 store.replaceReducer(rootReducer)
16 })
17 }
18
19 return store
20}
21
22export default configureStore

Callers 4

index.jsFile · 0.50
handleRenderFunction · 0.50
store.jsFile · 0.50
store.tsFile · 0.50

Calls 3

createStoreFunction · 0.85
applyMiddlewareFunction · 0.85
replaceReducerMethod · 0.80

Tested by

no test coverage detected