svrcekmichal / redux-axios-middleware

Redux middleware for fetching data with axios HTTP client
MIT License
920 stars 96 forks source link

Why is the response used next by default? #80

Open acrius opened 6 years ago

acrius commented 6 years ago

Hello! Many thanks to you for the work. I have a question. Why is the response used next by default? In this case, the action with the request goes through the chain of middlewares only after redux-axios-middleware. Thus, if we do, for example, the middleware of authentification, we will have to:

  1. Divide the middleware fo authentification into two to process the request and response. Insert them before and after redux-axios-middleware.
  2. Override onSuccess and onError methods in options. Why not call dispatch by default? Thanks!