Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function configureStore(opts: ConfigureStoreOptions) {
const thunkMiddleware = thunk.withExtraArgument(opts.extra)
// Persist Middleware
const persistedReducer = persistReducer(persistConfig, rootReducer)
const router = routerMiddleware(history)
const enhancer = applyMiddleware(thunkMiddleware, ...appMiddleware, router)
const store = createStore(persistedReducer, opts.initialState || {}, enhancer)
const persistor = persistStore(store, undefined, opts.persistCallback)
return { store, persistor }
}
export default function configureStore(initialState, history) {
// Add so dispatched route actions to the history
const reduxRouterMiddleware = routerMiddleware(history);
const middleware = applyMiddleware(thunk, reduxRouterMiddleware);
return createStore(rootReducer, initialState, middleware);
}
function configureStore(initialState) {
const router = routerMiddleware(history);
const sagaMiddleware = createSagaMiddleware();
const enhancer = applyMiddleware(router, sagaMiddleware);
const store = createStore(rootReducer, initialState, enhancer);
sagaMiddleware.run(sagas);
return store;
}
function configureStore() {
return createStore(
reducers,
{},
applyMiddleware(
routerMiddleware(history),
promise,
),
);
}
export default function configureStore(initialState, history, logger) {
const reduxRouterMiddleware = routerMiddleware(history)
let finalCreateStore = null
if (logger !== null) {
finalCreateStore = compose(
applyMiddleware(thunk, youversionApi, googleMapsApi, youversionAuth, reduxRouterMiddleware, logger)
)(createStore)
} else {
finalCreateStore = compose(
applyMiddleware(thunk, youversionApi, googleMapsApi, youversionAuth, reduxRouterMiddleware)
)(createStore)
}
return finalCreateStore(rootReducer, initialState)
}