I am trying to chain dispatches with redux thunk
function simple_action(){
return {type: \"SIMPLE_ACTION\"}
}
export function async_action(){
return fun
This is a pattern I've been using recently:
export const someThenableThunk = someData => (dispatch, getState) => Promise.resolve().then(() => {
const { someReducer } = getState();
return dispatch({
type: actionTypes.SOME_ACTION_TYPE,
someData,
});
});
When you dispatch(someThenableThunk('hello-world')), it returns a Promise object that you can chain further actions to.