dispatchOnMount: true has no effect when `process()` ends up not dispatching
tizmagik opened this issue · 2 comments
Description
When there is a top-level process
function defined and dispatchOnMount: true
is passed in and the result of calling process()
is to not dispatch, then the boolean for dispatchOnMount
essentially has no effect.
Expected Behavior
When dispatchOnMount: true
is passed in, it should always dispatch when the component mounts, unless the call to process()
has dispatched, then it shouldn't (because we wouldn't want to dispatch the same data twice).
Actual Behavior
When dispatchOnMount: true
is passed in, and there is a process()
function defined (that happens to not dispatch), then that flag is essentially ignored.
The root cause of the issue is the conditional logic here:
h/t @callihiggins
A workaround is to define { dispatchOnMount: () => true }
so that the first conditional L70
triggers