Skip to content

Instantly share code, notes, and snippets.

@baso53
Created October 22, 2018 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baso53/d4d0071e8114beb1076008cc7af0c0db to your computer and use it in GitHub Desktop.
Save baso53/d4d0071e8114beb1076008cc7af0c0db to your computer and use it in GitHub Desktop.
implementing-sagas-store-2
import { createStore, applyMiddleware } from "redux";
import reducer from "./reducer";
import MySaga from "./middleware";
import { ACTION_TYPES } from './reducer';
const sagaInstance = new MySaga();
sagaInstance.registerAction(ACTION_TYPES.FETCH_DATA_REQUEST, fetchDataWorker);
const store = createStore(reducer, applyMiddleware(sagaInstance.middleware));
export default store;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment