Created
April 16, 2019 21:03
-
-
Save Ledoux/73fe9d82357fe7883dbe2c298f29e810 to your computer and use it in GitHub Desktop.
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 { applyMiddleware, combineReducers, createStore } from "redux"; | |
import createSagaMiddleware from "redux-saga"; | |
import { all } from "redux-saga/effects"; | |
import { createDataReducer, watchDataActions } from "redux-saga-data"; | |
const sagaMiddleware = createSagaMiddleware(); | |
const storeEnhancer = applyMiddleware(sagaMiddleware); | |
function* rootSaga() { | |
yield all([ | |
watchDataActions({ | |
fetchData | |
}) | |
]); | |
} | |
const rootReducer = combineReducers({ data: createDataReducer({}) }); | |
const store = createStore(rootReducer, storeEnhancer); | |
sagaMiddleware.run(rootSaga); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment