Closed leobastin closed 11 months ago
If you're using an async
function, you need to call next(Action)
before you await
any futures.
If you are using redux_epics with flutter_redux, I can provide you an example to handle such scenarios.
With only flutter_redux, I didn't try.
After we start a fetch action: store.dispatch(FetchCustomerStartAction()); We expect the reducer for this action to kickstart immediately to change inProgress to true, while middleware is awaiting response from server. However, the middleware pattern will not pass control to the reducer (next(Action)) until server call returns in the middleware (await completes). This means the transition of state.inProgress is not useful. (Apologies if its because I've gotten it all wired wrongly)