-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I was curious about the order in which middleware is being applied by fetch-wrap. This is an awesome library that we use heavily for our projects. We ran into a curious case where it seems that custom middleware would need to be applied in reverse-order, bottom-to-top, instead of top-to-bottom. For example:
const newFetch = fetchWrap(originalFetch, [
doFirstThing(),
doSecondThing(),
doThirdThing()
]);
This would first call doThirdThing, then proceed backwards. Is this the intended behavior? I would hesitate to call it a "bug", since I see the test expectations in the repository that mimic these results. I have forked the repo and created a new test to better illustrate what I mean:
If this is something that you and the community would like to have adjusted, I would be happy to take a stab at it and submit a pull request.
Metadata
Metadata
Assignees
Labels
No labels