diff options
Diffstat (limited to 'client/store.js')
| -rw-r--r-- | client/store.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/client/store.js b/client/store.js new file mode 100644 index 00000000..13612f2d --- /dev/null +++ b/client/store.js @@ -0,0 +1,30 @@ +import { applyMiddleware, compose, combineReducers, createStore } from 'redux' +import thunk from 'redux-thunk' + +import faceSearchReducer from './faceSearch/faceSearch.reducer' +import nameSearchReducer from './nameSearch/nameSearch.reducer' + +const rootReducer = combineReducers({ + faceSearch: faceSearchReducer, + nameSearch: nameSearchReducer, +}) + +function configureStore(initialState = {}) { + const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose + + const store = createStore( + rootReducer, + initialState, + composeEnhancers( + applyMiddleware( + thunk, + ), + ), + ) + + return store +} + +const store = configureStore({}) + +export { store } |
