hyper/lib/store/configure-store.dev.ts

17 lines
689 B
TypeScript
Raw Normal View History

2020-01-02 08:49:57 -09:00
import {createStore, applyMiddleware} from 'redux';
2023-06-26 01:29:50 -08:00
import type {ThunkMiddleware} from 'redux-thunk';
import _thunk from 'redux-thunk';
import rootReducer from '../reducers/index';
import effects from '../utils/effects';
import * as plugins from '../utils/plugins';
import writeMiddleware from './write-middleware';
2020-01-02 08:49:57 -09:00
import {composeWithDevTools} from 'redux-devtools-extension';
2023-06-26 01:29:50 -08:00
import type {HyperState, HyperActions} from '../hyper';
const thunk: ThunkMiddleware<HyperState, HyperActions> = _thunk;
export default () => {
const enhancer = composeWithDevTools(applyMiddleware(thunk, plugins.middleware, thunk, writeMiddleware, effects));
return createStore(rootReducer, enhancer);
};