Redux - how to call an action creator from inside another activity creator?
I have the following action creator:
export function foo(param) {
...
}
and I want to call it from the adjacent action creator (in the same file) like this:
export function bar(param){
return (dispatch, getState) => {
dispatch({
type: ATYPE.SET_DO_THIS_BEFORE_FOO,
payload: param
});
foo(param);
}
}
but the action creator is foo
not triggered from within bar
. Is there a way to do this?
+3
source to share