Hi, I found a problem when I play around with the concept. I don't know if I miss something but here is the deal.
I found that in createMiddleware function, you actually call the MiddlewareItem first, then next(action). It works if the async action takes sometime, but when it is really fast, like as fast as reading local files, the success got processed before request in the reducer. Again, I don't know if I miss something. It causes problems if I have "fetching" state in the AppState, which I am using to notify the UI.
Hi, I found a problem when I play around with the concept. I don't know if I miss something but here is the deal.
I found that in
createMiddlewarefunction, you actually call theMiddlewareItemfirst, thennext(action). It works if the async action takes sometime, but when it is really fast, like as fast as reading local files, thesuccessgot processed beforerequestin the reducer. Again, I don't know if I miss something. It causes problems if I have "fetching" state in theAppState, which I am using to notify the UI.