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
Hey team!
Thank you so much for maintaining this package, we are absolutely loving it.
We're in the process of upgrading to V2, and have noticed a small Typescript issue during the upgrade. It appears that deferring a resolve chain is not supported in the V2 types.
Here is a small repro:
importwretchfrom'wretch'consthandle403=()=>{console.log('Unauthorized!')}constclient=wretch('https://my-base-url.com').defer((wretch)=>{returnwretch// Argument of type '(wretch: Wretch<unknown, unknown, undefined>) => Wretch<unknown, unknown, WretchResponseChain<unknown, unknown, undefined>>'// is not assignable to parameter of type 'WretchDeferredCallback<unknown, unknown, undefined>'.resolve((_)=>_.forbidden(handle403));})})
Argument of type '(wretch: Wretch<unknown, unknown, undefined>) =>
Wretch<unknown, unknown, WretchResponseChain<unknown, unknown, undefined>>'
is not assignable to parameter of type 'WretchDeferredCallback<unknown, unknown, undefined>'
We like to modify requests made in the deferred callback, but can't in V2. Are we doing something wrong?
Thank you so much!
The text was updated successfully, but these errors were encountered:
Thank you so much for maintaining this package, we are absolutely loving it.
Thanks, this is heartwarming 🙇.
We like to modify requests made in the deferred callback, but can't in V2. Are we doing something wrong?
No you're not 😉. There is definitely someting fishy with the return type of the .defer() function.
I just released version 2.1.4 which includes a fix and it should hopefully solve the problem.
Feel free to reopen the issue otherwise, and thanks for reporting the bug! 👍
Hey team!
Thank you so much for maintaining this package, we are absolutely loving it.
We're in the process of upgrading to V2, and have noticed a small Typescript issue during the upgrade. It appears that deferring a resolve chain is not supported in the V2 types.
Here is a small repro:
We like to modify requests made in the deferred callback, but can't in V2. Are we doing something wrong?
Thank you so much!
The text was updated successfully, but these errors were encountered: