1
0
mirror of https://github.com/yldio/copilot.git synced 2024-12-03 00:20:04 +02:00
copilot/frontend/src/state/store.js
2016-10-20 10:58:19 +01:00

27 lines
622 B
JavaScript

const createLogger = require('redux-logger');
const createReducer = require('./reducers');
const enableBatching = require('redux-batched-actions').enableBatching;
const promiseMiddleware = require('redux-promise-middleware').default;
const redux = require('redux');
const thunk = require('redux-thunk').default;
const {
createStore,
compose,
applyMiddleware
} = redux;
module.exports = (state = Object.freeze({})) => {
return createStore(
enableBatching(createReducer()),
state,
compose(
applyMiddleware(
createLogger(),
promiseMiddleware(),
thunk
)
)
);
};