dev.ts 445 B

12345678910111213141516
  1. import { createStore, applyMiddleware, compose } from 'redux';
  2. import thunk from 'redux-thunk';
  3. import rootReducer from '../../reducers';
  4. export default () => {
  5. const middlewares = [thunk];
  6. const composeEnhancers =
  7. (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
  8. const enhancer = composeEnhancers(applyMiddleware(...middlewares));
  9. const store = createStore(rootReducer, undefined, enhancer);
  10. return store;
  11. };