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:
Jacob Kozol 2021-04-16 14:14:18 +02:00 committed by Sanne Raymaekers
parent fbada9d990
commit 8a8a7229a1
2 changed files with 4 additions and 1 deletions

View file

@ -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
]);