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而不是定制的中间件?