Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let reducers = {};
const additionalReducers = additionalConfiguration.reducers;
if (additionalReducers) {
reducers = {
...additionalReducers,
};
}
const sagaMiddleware = createSagaMiddleware();
const middlewares = [sagaMiddleware];
const additionalMiddlewares = additionalConfiguration.middlewares;
if (additionalMiddlewares) {
middlewares.push(...additionalMiddlewares);
}
const store = cmfStore.initialize(reducers, initialState, undefined, middlewares);
sagaMiddleware.run(rootSaga);
api.registerInternals();
/**
* Register route functions
*/
const additionalRouteFunctions = additionalConfiguration.routeFunctions;
if (additionalRouteFunctions) {
Object.keys(additionalRouteFunctions).map(k =>
registerRouteFunction(k, additionalRouteFunctions[k]),
);
}
registerAllContainers();
* - Register your components in the CMF dictionary
* - Register action creators in CMF actions dictionary
*/
configure.initialize();
/**
* Register react-router-redux router reducer (see https://github.com/reactjs/react-router-redux)
*/
const history = createHistory();
cmfstore.setRouterMiddleware(routerMiddleware(history));
/**
* Register your app reducers
*/
const sagaMiddleware = createSagaMiddleware();
const store = cmfstore.initialize(appReducer, undefined, undefined, [sagaMiddleware]);
/**
* Run main saga
*/
configure.runSagas(sagaMiddleware, history);
/**
* Fetch the CMF settings and configure the CMF app
*/
store.dispatch(actions.settings.fetchSettings('/settings.json'));
/**
* Render the CMF App
*/
render(
,
let reducers = {};
const additionalReducers = additionalConfiguration.reducers;
if (additionalReducers) {
reducers = {
...additionalReducers,
};
}
const sagaMiddleware = createSagaMiddleware();
const middlewares = [sagaMiddleware];
const additionalMiddlewares = additionalConfiguration.middlewares;
if (additionalMiddlewares) {
middlewares.push(...additionalMiddlewares);
}
const store = cmfStore.initialize(reducers, preloadedState, undefined, middlewares);
sagaMiddleware.run(rootSaga);
api.registerInternals();
/**
* Register route functions
*/
const additionalRouteFunctions = additionalConfiguration.routeFunctions;
if (additionalRouteFunctions) {
Object.keys(additionalRouteFunctions).map(k =>
registerRouteFunction(k, additionalRouteFunctions[k]),
);
}
registerAllContainers();
constructor(props) {
super(props);
let state;
if (props) {
state = props.state;
}
if (!state) {
state = mock.state();
}
let middlewares = this.props.middleware;
if (props.sagaMiddleware) {
middlewares = middlewares.concat([props.sagaMiddleware]);
}
this.store = store.initialize(props.reducer, state, props.enhancer, middlewares);
if (props.sagaMiddleware) {
api.registerInternals();
props.sagaMiddleware.run(initSagaMiddleWare);
}
}