Thunk instead of a custom middleware?
I have the following middleware. this middleware acts like the redux-thunk middleware, but passing the dispatcher and the state getter to the action creator function, but also I pass the next middleware that can be called. in this case I can export all my middlewares like this
so In my action creator, instead of dispatching the action, I just pass it to the next middleware.
I just want to know why I should use redux-thunk instead of this simple customThunk middleware?
链接地址: http://www.djcxy.com/p/59060.html上一篇: Redux Promise和Redux Promise Middleware有什么意义?
下一篇: Thunk而不是定制的中间件?