Configure redux-thunk
This commit is contained in:
Родитель
b21837986b
Коммит
11de690d98
|
@ -1,8 +1,11 @@
|
|||
import { createStore, combineReducers } from 'redux';
|
||||
import { createStore, combineReducers, applyMiddleware } from 'redux';
|
||||
import thunk from 'redux-thunk';
|
||||
import * as reducers from 'reducers';
|
||||
|
||||
export function createReduxStore() {
|
||||
return createStore(combineReducers(reducers));
|
||||
const reducer = combineReducers(reducers);
|
||||
const finalCreateStore = applyMiddleware(thunk)(createStore);
|
||||
return finalCreateStore(reducer);
|
||||
}
|
||||
|
||||
export default createReduxStore();
|
||||
|
|
Загрузка…
Ссылка в новой задаче