initial commit

This commit is contained in:
Stuart Taylor
2018-04-06 14:51:52 +01:00
committed by Mrugesh Mohapatra
parent 1314830576
commit 15aae9a57c
146 changed files with 44507 additions and 8380 deletions

View File

@@ -0,0 +1,30 @@
import {
createStore as reduxCreateStore,
combineReducers,
applyMiddleware
} from 'redux';
import { combineEpics, createEpicMiddleware } from 'redux-observable';
import { routerReducer as router, routerMiddleware } from 'react-router-redux';
import { reducer as challenge, epics } from '../templates/Challenges/redux';
import { reducer as map } from '../components/Map/redux';
const rootReducer = combineReducers({
challenge,
map,
router
});
const rootEpic = combineEpics(...epics);
const epicMiddleware = createEpicMiddleware(rootEpic, {
dependencies: {
window: typeof window !== 'undefined' ? window : {},
document: typeof window !== 'undefined' ? document : {}
}
});
export const createStore = history =>
reduxCreateStore(
rootReducer,
applyMiddleware(epicMiddleware, routerMiddleware(history))
);