-
Notifications
You must be signed in to change notification settings - Fork 200
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
Type is no longer compatible with fetch #144
Comments
Ahh, yeah this is an interesting point. We'll likely have to go back to the old defs... |
we have similar problem in using apollo-upload-client.
This module using |
Yup can we please downgrade to the old deps. |
I'm having issues too with the types from #117
|
@developit is there any reason we can't just export the types? I don't want to worry about compatibility issues - I don't use |
To others looking for the response type: I managed to break in and steal the promised return-type... yoinks import type unfetch from "unfetch";
type AsyncReturnType<T extends (...args: any) => any> =
T extends (...args: any) => Promise<infer U>
? U
: unknown;
export type Response = AsyncReturnType<typeof unfetch>; |
This should be fixed by #159, which is now released as Unfetch 5.0.0. |
Unfetch used to declare it's type as
typeof fetch
which was working well for us.Now it uses a custom type, which gives us errors when we try to pass it as a parameter to a function expecting something compatible with
fetch
:The text was updated successfully, but these errors were encountered: