Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon types are lost after passing through the catcher handler #177

Closed
vkozio opened this issue Apr 11, 2023 · 1 comment
Closed

Addon types are lost after passing through the catcher handler #177

vkozio opened this issue Apr 11, 2023 · 1 comment
Labels

Comments

@vkozio
Copy link

vkozio commented Apr 11, 2023

Problem with defer was fixed in #140

But there's similar problem with using .catcher(code, async (error, originalRequest) ...
originalRequest type is Wretch<Self, Chain, Resolver> , not Self & Wretch<Self, Chain, Resolver>

elbywan added a commit that referenced this issue Apr 11, 2023
@elbywan elbywan added the bug label Apr 11, 2023
@elbywan
Copy link
Owner

elbywan commented Apr 11, 2023

Hey @vkozio 👋 ,

Thanks for reporting the issue! I've just released v2.5.2 which includes a fix that should hopefully provide the right types.

wretch().addon(QueryAddon).resolve((r, w) => {
  // No typescript error with wretch@2.5.2:
  w.query({ a: 1, b: 2 })
  return r
})

Feel free to reopen if I missed something.

@elbywan elbywan closed this as completed Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants