Created
October 22, 2018 19:10
-
-
Save baso53/d4d0071e8114beb1076008cc7af0c0db to your computer and use it in GitHub Desktop.
implementing-sagas-store-2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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