store: add redux-thunk
Redux thunks allow actions to pass functions. This will be helpful when our api calls are moved into redux actions instead of being handled within react components.
This commit is contained in:
parent
fbada9d990
commit
8a8a7229a1
2 changed files with 4 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import ReducerRegistry from '@redhat-cloud-services/frontend-components-utilities/files/ReducerRegistry';
|
||||
import promiseMiddleware from 'redux-promise-middleware';
|
||||
import thunk from 'redux-thunk';
|
||||
import { notificationsReducer } from '@redhat-cloud-services/frontend-components-notifications/redux';
|
||||
|
||||
import composes from './reducers/composes';
|
||||
|
|
@ -14,6 +15,7 @@ export function init (store = {}, ...middleware) {
|
|||
|
||||
registry = new ReducerRegistry(store, [
|
||||
promiseMiddleware,
|
||||
thunk,
|
||||
...middleware
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue