diff options
First simple version of ui mocker
Diffstat (limited to 'development/mockStore.js')
-rw-r--r-- | development/mockStore.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/development/mockStore.js b/development/mockStore.js new file mode 100644 index 000000000..1299ee1dc --- /dev/null +++ b/development/mockStore.js @@ -0,0 +1,18 @@ +const createStore = require('redux').createStore +const applyMiddleware = require('redux').applyMiddleware +const thunkMiddleware = require('redux-thunk') +const createLogger = require('redux-logger') +const rootReducer = require('../ui/app/reducers') + +module.exports = configureStore + +const loggerMiddleware = createLogger() + +const createStoreWithMiddleware = applyMiddleware( + thunkMiddleware, + loggerMiddleware +)(createStore) + +function configureStore (initialState) { + return createStoreWithMiddleware(rootReducer, initialState) +} |