const configureStore = preloadedState => { const sagaMiddleware = createSagaMiddleware(); const middlewares = applyMiddleware(sagaMiddleware); const store = createStore(reducers, preloadedState, middlewares); sagaMiddleware.run(sagas); return store; }
export default function configureStore () { const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose const sagaMiddleware = createSagaMiddleware() const middlewares = [sagaMiddleware] if (!PRODUCTION) { middlewares.push(createLogger()) } const enhancer = composeEnhancers(applyMiddleware(...middlewares)) const store = createStore(reducer, enhancer) sagaMiddleware.run(rootSaga) return { store } }
const configureStore = () => { const sagaMiddleware = createSagaMiddleware(); // Redux debug tool (source: https://github.com/zalmoxisus/redux-devtools-extension) const composeEnhancers = (process.env.NODE_ENV === 'development' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose; const store = createStore( rootReducer, getInitialState(), composeEnhancers(applyMiddleware(sagaMiddleware, persistMiddleware)), ); sagaMiddleware.run(rootSaga); return store; }
// import sagaMonitor from '../../../sagaMonitor'; export default function configureStore() { const sagaMiddleware = createSagaMiddleware(); return { ...createStore( rootReducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), applyMiddleware(sagaMiddleware), ), runSaga: sagaMiddleware.run, }; }
export default function configureStore (preloadedState) { const sagaMiddleware = createSagaMiddleware(); const store = createStore( rootReducer, preloadedState, compose( applyMiddleware(sagaMiddleware), window && window.devToolsExtension ? window.devToolsExtension() : (passThrough) => passThrough ) ); sagaMiddleware.run(rootSaga); return store; }
function configure() { const sagaMiddleware = createSagaMiddleware(); const create = window.devToolsExtension ? window.devToolsExtension()(createStore) : createStore; const createStoreWithMiddleware = applyMiddleware( logger, sagaMiddleware )(create); const store = createStoreWithMiddleware( rootReducer, autoRehydrate(), ); persistStore(store); sagaMiddleware.run(rootSaga); return store; }
export default function configureStore(initialState, browserHistory) { const sagaMiddleware = createSagaMiddleware({sagaMonitor}) const persistedState = loadState() const routermw = routerMiddleware(browserHistory) const store = createStore( combinedReducers, persistedState, compose( applyMiddleware(routesMiddleware), composeEnhancers(applyMiddleware(sagaMiddleware)) ) ); sagaMiddleware.run(rootSaga) store.subscribe(() => { saveState(store.getState()) }) return store }
export default function configureStore({ rootReducer, initialState = {}, sagas = [] }) { const sagaMiddleware = createSagaMiddleware(); const store = { ...createStore( rootReducer, initialState, applyMiddleware(sagaMiddleware) ), runSaga: sagaMiddleware.run, }; setImmediate( () => sagas.forEach(saga => store.runSaga(saga.generator, saga.param)) ); return store; }
const configStore =() =>{ const sagaMiddleware = createSagaMiddleware(); const store = createStore( rootReducer, applyMiddleware(sagaMiddleware, logger,routerMiddleware(history)) ); sagaMiddleware.run(rootSaga); return store; }
export default function configureStore(initialState) { const sagaMiddleware = createSagaMiddleware(); let store; if (initialState) { store = createStore( reducers, initialState, composeWithDevTools(applyMiddleware(sagaMiddleware)), ); } else { store = createStore( reducers, composeWithDevTools(applyMiddleware(sagaMiddleware)), ); } sagaMiddleware.run(rootSaga); return store; }
const configureStore = history => { const sagaMiddleware = createSagaMiddleware() const store = createStore( rootReducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), compose( applyMiddleware(sagaMiddleware), persistState("", { key: "redux", slicer, }) ) ) sagaMiddleware.run(rootSaga) return store }
export default function configureStore(initialState) { const sagaMiddleware = createSagaMiddleware(); const store = createStore( combineReducers({ auth: authReducers, // routing: routerReducer }), initialState, applyMiddleware( sagaMiddleware, loggerMiddleware ) ); sagaMiddleware.run(rootSaga); return store; }
const configureStore = () => { const sagaMiddleware = createSagaMiddleware(); return { ...createStore(rootReducer, applyMiddleware(sagaMiddleware)), runSaga: sagaMiddleware.run(rootSaga) } }
const configureStore = () => { const sagaMiddleware = createSagaMiddleware({sagaMonitor}) const store = createStore(rootReducer, compose(applyMiddleware(sagaMiddleware))) sagaMiddleware.run(rootSaga) return store }
export default function configureStore() { const sagaMiddleware = createSagaMiddleware(); const store = createStore(reducer, applyMiddleware(sagaMiddleware)); sagaMiddleware.run(rootSaga); return store; }