joyent-portal/frontend/src/state/store.js

27 lines
622 B
JavaScript
Raw Normal View History

2016-10-20 04:14:26 +03:00
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
)
)
);
};