-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Any interest in supporting more complex use cases for thunks (like injecting an API client)?
const export myAction = (data) => (dispatch, getState, helpers) => {
return helpers.client.get(PATH, options).then(doStuff);
}
Doesn't need to be a breaking change; we can export a factory:
export const createThunkMiddleware = (any) => ({ dispatch, getState }) => next => action => {
if (typeof action === 'function') {
return action(dispatch, getState, any);
}
return next(action);
};
export default createThunkMiddleware();
Metadata
Metadata
Assignees
Labels
No labels