Skip to content

Instantly share code, notes, and snippets.

@baso53
Created October 22, 2018 19:10
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