Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Porter97
Last active March 30, 2020 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/224d2d799a85a66d7bfa2801397a04a5 to your computer and use it in GitHub Desktop.
Save Porter97/224d2d799a85a66d7bfa2801397a04a5 to your computer and use it in GitHub Desktop.
import { applyMiddleware, combineReducers, createStore } from 'redux';
import { localStorageMiddleware, promiseMiddleware} from "./middleware";
import { routerMiddleware, routerReducer } from 'react-router-redux'
import createHistory from 'history/createHashHistory';
import auth from './reducers/auth';
import common from './reducers/common';
export const history = createHistory();
const myRouterMiddleware = routerMiddleware(history);
const reducer = combineReducers({
auth,
common,
router: routerReducer
});
const middleware = applyMiddleware(myRouterMiddleware, promiseMiddleware, localStorageMiddleware);
const store = createStore(reducer, middleware);
export default store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment