Last active
February 15, 2018 20:07
-
-
Save mohandere/4e734bbc07f728ef51e72e0b8b14ddf6 to your computer and use it in GitHub Desktop.
Getting started with create-react-app, Redux, React Router, Redux observable & React Bootstrap(reactstrap)
This file contains hidden or 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 { createEpicMiddleware } from 'redux-observable'; | |
import createHistory from 'history/createHashHistory'; | |
import { routerMiddleware } from 'react-router-redux'; | |
// import root epic/reducer | |
import rootEpic from './rootEpic'; | |
import rootReducer from './rootReducer'; | |
import queryString from 'query-string'; | |
// export `history` to use in index.js, we using `createBrowserHistory` | |
export const history = createHistory(); | |
const epicMiddleware = createEpicMiddleware(rootEpic, { | |
dependencies: { | |
queryString | |
} | |
}); | |
// Build the middleware for intercepting and dispatching navigation actions | |
const appRouterMiddleware = routerMiddleware(history); | |
const store = createStore(rootReducer, applyMiddleware(epicMiddleware), applyMiddleware(appRouterMiddleware)); | |
export default store; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment