How to use the redux-observable/lib/cjs/createEpicMiddleware.createEpicMiddleware function in redux-observable

To help you get started, we’ve selected a few redux-observable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Amin52J / React-Redux-Enterprise / app / constants / store.js View on Github external
import hocReducer from '@hoc/cleanOnUnmount/reducer';
import * as reducers from '@reducers';
import epics from '@epics';

// global definitions
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/takeUntil';
// ------------------

export const history = createHistory();

// the epics middleware
const epicMiddleware = createEpicMiddleware(epics, {
  dependencies: {
    getJSON: ajax.getJSON,
    of,
  },
});

// the reducers
const combinedReducers = combineReducers({
  ...reducers,
  routing: routerReducer,
});
const reducer = hocReducer(combinedReducers); // adds reset reducer to our apps reducer
const store = createStore(
  reducer,
  applyMiddleware(epicMiddleware, routerMiddleware(history)),
);