diff options
| author | Adam Harvey <adam@ahprojects.com> | 2018-12-23 01:37:03 +0100 |
|---|---|---|
| committer | Adam Harvey <adam@ahprojects.com> | 2018-12-23 01:37:03 +0100 |
| commit | 4452e02e8b04f3476273574a875bb60cfbb4568b (patch) | |
| tree | 3ffa44f9621b736250a8b94da14a187dc785c2fe /client/store.js | |
| parent | 2a65f7a157bd4bace970cef73529867b0e0a374d (diff) | |
| parent | 5340bee951c18910fd764241945f1f136b5a22b4 (diff) | |
.
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 } |
