2017-08-13 01:35:09 +00:00
|
|
|
import { createStore, applyMiddleware } from 'redux';
|
|
|
|
import thunk from 'redux-thunk';
|
|
|
|
import logger from 'redux-logger';
|
|
|
|
import rootReducer from '../reducers/rootReducer';
|
|
|
|
|
|
|
|
let middleware = [thunk];
|
|
|
|
|
|
|
|
if (__DEV__) {
|
|
|
|
/* eslint-disable global-require */
|
|
|
|
const reduxImmutableStateInvariant = require('redux-immutable-state-invariant').default();
|
|
|
|
middleware = [...middleware, reduxImmutableStateInvariant, logger];
|
|
|
|
} else {
|
|
|
|
middleware = [...middleware];
|
|
|
|
}
|
|
|
|
|
2017-08-13 23:02:46 +00:00
|
|
|
export default createStore(
|
|
|
|
rootReducer,
|
|
|
|
undefined,
|
|
|
|
applyMiddleware(...middleware)
|
|
|
|
);
|