Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function configureServiceStore(preloadedState, appReducer) {
const baseReducer = combineReducers(Object.assign({}, serviceReducer, appReducer));
return createStore(
enableBatching(baseReducer),
preloadedState,
applyMiddleware(thunk)
);
}
export default function configureStore(API) {
const callAPIMiddleware = getAPIMiddleware(API);
const middleware = [
callAPIMiddleware,
throwOnAsyncErrorMiddleware,
thunkMiddleware,
batchDispatchMiddleware,
];
return createStore(enableBatching(reducer), applyMiddleware(...middleware));
}
function createReducer(...reducers) {
const baseReducer = combineReducers(Object.assign({}, ...reducers));
return enableFreezing(enableBatching(baseReducer));
}
function getReducer(appReducer) {
let reducerObject = {};
if (appReducer) {
if (typeof appReducer === 'object') {
reducerObject = Object.assign({}, appReducer);
} else if (typeof appReducer === 'function') {
reducerObject = { app: appReducer };
}
} else {
invariant(true, 'Are you sure you want to bootstrap an app without reducers ?');
}
if (!reducerObject.cmf) {
reducerObject.cmf = cmfReducers;
}
return enableBatching(preApplyReducer(combineReducers(reducerObject)));
}