Created
December 3, 2018 09:00
-
-
Save DengYiping/9117efd390d8fe7b50063bfcdb7fc21e to your computer and use it in GitHub Desktop.
Configure Redux Store and Redux Observable
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 rootReducer from '../reducer/rootReducer'; | |
import { createStore, applyMiddleware } from 'redux'; | |
import { createEpicMiddleware } from 'redux-observable'; | |
import rootEpic from '../epic/rootEpic'; | |
function configureStore(default_state = {}){ | |
const epicMiddleware = createEpicMiddleware(); | |
const store = createStore( | |
rootReducer, | |
default_state, | |
applyMiddleware(epicMiddleware) | |
); | |
epicMiddleware.run(rootEpic); | |
return store; | |
} | |
export default configureStore; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment