BetterTyped / hyper-fetch

⚡ Fetching and realtime data exchange framework.
https://hyperfetch.bettertyped.com/
Apache License 2.0
1.02k stars 27 forks source link

built-in send() function should return properly typed data / error objects #46

Closed stefanullinger closed 1 year ago

stefanullinger commented 1 year ago

Hi, in my latest TypeScript project, I needed to call a method that should dispatch the actual request using the built-in send() function mentioned in the docs here: https://hyperfetch.bettertyped.com/docs/guides/basic/dispatching/

Unfortunately, the returned data and error objects are of type any, which makes it hard to work on the result. What am I doing wrong? How can I fix it?

I have prepared a CodeSandbox here: https://codesandbox.io/s/hyper-fetch-send-not-providing-typed-result-0pc3kw?file=/src/App.tsx

Best Stefan

prc5 commented 1 year ago

@stefanullinger Sorry for this, we are going to fix all typescript issues in 4.0 coming next week! https://github.com/BetterTyped/hyper-fetch/pull/47/files

stefanullinger commented 1 year ago

Alright, thanks a lot!

prc5 commented 1 year ago

@stefanullinger Hey! Just wanted to let you know, that we posted the blog post about the new release and as we wanted to thank you for your help, we added a special thanks section to show gratitude for the support you show us. Thank you!

You can find it here: https://hyperfetch.bettertyped.com/blog/hyper-fetch-5-0/

stefanullinger commented 1 year ago

@prc5 Thank you very much - it is working perfectly now!