// Build the middleware for intercepting and dispatching navigation actions //const myRouterMiddleware = routerMiddleware(history); export default function configureStore(preloadedState) { const store = createStore( reducer(history), preloadedState, compose(applyMiddleware(routerMiddleware(history), thunk)) ); // root reducer with router state // for dispatching history actions // ... other middlewares ... return store; }
export default function configureStore(preloadedState) { const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; const store = createStore( createRootReducer(history), preloadedState, composeEnhancer(applyMiddleware(routerMiddleware(history)), applyMiddleware(thunk)) ); return store; }
export function configureStore(preloadedState) { const middlewares = [ thunkMiddleware, routerMiddleware(history), ].filter(Boolean); store = createStore( createRootReducer(history), preloadedState, composeWithDevTools(applyMiddleware(...middlewares)), ); for (const initializer of initializers) { initializer(store); } return store; }
const configureStore = (history) => { const router = routerMiddleware(history); middleware = [...middleware, router]; const store = createStore( connectRouter(history)(reducer), composeEnhancers(applyMiddleware(...middleware)), ); return store; }
export default function configureStore (history, initialState) { const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; // Middleware wrapper for Redux DevTools browser extension // Enable hot-reloading reducers. if (module.hot) { module.hot.accept('./ducks', () => { const newReducers = require('./ducks/index.js'); // eslint-disable-line global-require store.replaceReducer(generateRootReducer(newReducers, history)); }); } const store = createStore( generateRootReducer(reducers, history), initialState, composeEnhancers(applyMiddleware( thunk, routerMiddleware(history) )) ); return store; }
const configureStore = (initialState, history) => { const store = createStore( createRootReducer(history), initialState, compose( applyMiddleware(routerMiddleware(history), thunk), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f, // eslint-disable-line ), ); if (module.hot) { module.hot.accept('./reducer', () => { store.replaceReducer(createRootReducer(history)); }); } return store; }
const configureStore = (sagaMiddleware, storeHistory) => { //const sagaMiddleware = createSagaMiddleware() const reducers = createRootReducer(storeHistory); // console.log(reducers.router); const store = createStore( persistReducer(persistConfig, reducers), // root reducer with router state initialState, compose( applyMiddleware( routerMiddleware(storeHistory), // for dispatching history actions sagaMiddleware, createLogger() ) // window.__REDUX_DEVTOOLS_EXTENSION__ && // window.__REDUX_DEVTOOLS_EXTENSION__() //DevTools.instrument() ) ); //sagaMiddleware.run(rootSaga) const persistor = persistStore(store); return { store, persistor }; }
export default function configureStore(preloadedState?:any): Store<IAppState, any> { return createStore( rootReducer(history), preloadedState, composeWithDevTools(applyMiddleware(thunk, routerMiddleware(history)))); }
function configureStoreProd(initialState) { const reactRouterMiddleware = routerMiddleware(history); const middlewares = [ // Add other middleware on this line... // thunk middleware can also accept an extra argument to be passed to each thunk action // https://github.com/reduxjs/redux-thunk#injecting-a-custom-argument thunk, reactRouterMiddleware, ]; return createStore( connectRouterHistory(rootReducer), initialState, compose(applyMiddleware(...middlewares)) ); }
export default function configureStore(preloadedState) { const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose const store = createStore( createRootReducer(history), preloadedState, composeEnhancer( applyMiddleware( routerMiddleware(history), ), ), ) // Hot reloading if (module.hot) { // Enable Webpack hot module replacement for reducers module.hot.accept('./reducers', () => { store.replaceReducer(createRootReducer(history)); }); } return store }
/** * @param preloadedState * @returns {Store<any, Action> & *} */ export default function configureStore(preloadedState) { return createStore( reducers(history), preloadedState, compose( applyMiddleware( routerMiddleware(history), thunk ) ) ); }
const configureStore = (sagaMiddleware, storeHistory) => { //const sagaMiddleware = createSagaMiddleware() const reducers = createRootReducer(storeHistory); //console.log(reducers.router); const store = createStore( persistReducer(persistConfig, reducers), // root reducer with router state initialState, compose( applyMiddleware( routerMiddleware(storeHistory), // for dispatching history actions sagaMiddleware //createLogger() ) // window.__REDUX_DEVTOOLS_EXTENSION__ && // window.__REDUX_DEVTOOLS_EXTENSION__() //DevTools.instrument() ) ); //sagaMiddleware.run(rootSaga) const persistor = persistStore(store); return { store, persistor }; }
function configureStoreProd(initialState) { const reactRouterMiddleware = routerMiddleware(history); const middlewares = [thunk, reactRouterMiddleware]; return createStore( createRootReducer(history), // root reducer with router state initialState, compose(applyMiddleware(...middlewares)) ); }
export default function configureStore(preloadedState) { const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; const store = createStore( createRootReducer(history), preloadedState, composeEnhancer(applyMiddleware(routerMiddleware(history)), applyMiddleware(thunk)) ); return store; }
/** * @param preloadedState * @returns {Store<any, Action> & *} */ export default function configureStore(preloadedState) { return createStore( reducers(history), preloadedState, compose( applyMiddleware( routerMiddleware(history), thunk ) ) ); }