You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 22, 2023. It is now read-only.
The request interception, response interception, etc is quite useful and I wouldn't think would add much to the library. Is there a way to simulate this on top of the library? (I don't see an obvious one)
Proposal
Add a single pre-flight and post-flight hook argument to the methods.
I like the idea in general. But one difficulty to adding this is the type inference. The library gives you types that 100% match your schema, so any middleware transforms would have to basically not transform your types, otherwise your types are unreliable (if you overrode any response types generated by this library, then I’d argue this library isn’t doing anything for you).
Or should the middleware not be transform-based (and if not, what would be a good example)?
Yeah, it's an interesting question. I'd think some well placed generic type args probably do what's needed, but it's often more about "fetch like things." i.e. we currently do request timing and telemetry, header manipulation, generic retry handling, and oauth retry handling (got a 401 saying token expire? go run this async function and then try again. got a 403? return the error). It very well may be that this can all be done different ways (for example being able to pass in a fetch function), but if that's the case then the feature is examples/docs.
Description
The request interception, response interception, etc is quite useful and I wouldn't think would add much to the library. Is there a way to simulate this on top of the library? (I don't see an obvious one)
Proposal
Add a single pre-flight and post-flight hook argument to the methods.
Checklist
The text was updated successfully, but these errors were encountered: