2023-07-25 09:30:19 -08:00
|
|
|
import {composeWithDevTools} from '@redux-devtools/extension';
|
2020-01-02 08:49:57 -09:00
|
|
|
import {createStore, applyMiddleware} from 'redux';
|
2023-06-26 01:29:50 -08:00
|
|
|
import _thunk from 'redux-thunk';
|
2023-07-25 09:30:19 -08:00
|
|
|
import type {ThunkMiddleware} from 'redux-thunk';
|
|
|
|
|
|
|
|
|
|
import type {HyperState, HyperActions} from '../../typings/hyper';
|
2016-09-21 14:11:42 -08:00
|
|
|
import rootReducer from '../reducers/index';
|
|
|
|
|
import effects from '../utils/effects';
|
|
|
|
|
import * as plugins from '../utils/plugins';
|
2023-07-25 09:30:19 -08:00
|
|
|
|
2017-09-25 03:55:04 -08:00
|
|
|
import writeMiddleware from './write-middleware';
|
2023-07-25 09:30:19 -08:00
|
|
|
|
2021-03-04 10:33:34 -09:00
|
|
|
const thunk: ThunkMiddleware<HyperState, HyperActions> = _thunk;
|
2016-09-21 14:11:42 -08:00
|
|
|
|
2023-07-25 08:11:02 -08:00
|
|
|
const configureStoreForDevelopment = () => {
|
2021-03-04 10:33:34 -09:00
|
|
|
const enhancer = composeWithDevTools(applyMiddleware(thunk, plugins.middleware, thunk, writeMiddleware, effects));
|
2016-09-21 14:11:42 -08:00
|
|
|
|
2017-09-10 05:35:10 -08:00
|
|
|
return createStore(rootReducer, enhancer);
|
2016-09-21 14:11:42 -08:00
|
|
|
};
|
2023-07-25 08:11:02 -08:00
|
|
|
|
|
|
|
|
export default configureStoreForDevelopment;
|