Closed ezzabuzaid closed 4 years ago
Hey, sure, that's a possibility. Although if you don't mind me asking which would be a case in which you'd need it. When I did that I just thought that it'd be good to have them apply changes in the order that they were added.
Hi, Angular does that with the interceptors, and I liked much, the first case is the logging, when I want to log the time needed for the request to finish, and there's a variety of cases may you want
I think it can be an option, reverse or not, and believe me it's useful.
and I was thinking about some useful changes
modify the request object to have a data or config, whatever
prop that will be used to transfer data from one interceptor to another, a use case for that when I want to use a default URL or not, so I can modify my request according to that without the needs to create a new HTTP instance and make it bypasses the interceptors, this is one and there are other use cases.
decode the body without the need to do it every time when in each request
and I want to thank you for that effort.
Yeah, that sounds like a good idea, I'll add it as a feature for release 1.0.0 hopefully coming soon.
As I'm planning to separate into different contracts the request and response interceptors then I won't be adding the reverse order flag for now.
Hi, it will be good if the interceptors execute the response method from the end back to the start
in the
for
loop, maybe you can loop over the interceptors from the end