I'm kind a new to using userReducer with Context API, so I'm not sure how I can call dispatch function from another useReducer.
useReducerB
...code...
function someFunction()
{
dispatch(otherActions.B) // this action i like to call from another reducer
}
useReducerA
const { someFunction } = useContext();
dispatch(actions.A); // this is the current reducer
someFunction(params) // dispatch action from another reducer
App
<ContextB.Provider value={someFunction}>
<ContextA.Provider value={...}>
As u can see the provider for the function is level above the context where I like to call dispatch.
I found out that u can write custom combine reducers utils, but I like to know if this is possible.
I'm getting error XXX is not a function...
Br, Igor