use configureStore of redux-toolkit instead of createStore of redux (#24790)
parent
2839fbc733
commit
8227af8dcc
@ -1,15 +1,16 @@
|
|||||||
import { createStore, applyMiddleware, compose } from 'redux';
|
import { configureStore } from '@reduxjs/toolkit';
|
||||||
import thunk from 'redux-thunk';
|
import thunk from 'redux-thunk';
|
||||||
import appReducer from '../reducers';
|
import appReducer from '../reducers';
|
||||||
import loadingBarMiddleware from '../middleware/loading_bar';
|
import loadingBarMiddleware from '../middleware/loading_bar';
|
||||||
import errorsMiddleware from '../middleware/errors';
|
import errorsMiddleware from '../middleware/errors';
|
||||||
import soundsMiddleware from '../middleware/sounds';
|
import soundsMiddleware from '../middleware/sounds';
|
||||||
|
|
||||||
export default function configureStore() {
|
export const store = configureStore({
|
||||||
return createStore(appReducer, compose(applyMiddleware(
|
reducer: appReducer,
|
||||||
|
middleware: [
|
||||||
thunk,
|
thunk,
|
||||||
loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
|
loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
|
||||||
errorsMiddleware(),
|
errorsMiddleware(),
|
||||||
soundsMiddleware(),
|
soundsMiddleware(),
|
||||||
), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
|
],
|
||||||
}
|
});
|
||||||
|
Loading…
Reference in new issue