Generic options?
#2335
-
Is there a way to make options generic and take the return value type as a type parameter? I have a custom mutator defined like this: function async mutator<Data>(config: RequestConfig, options?: Options<Data>): Promise<TypedResponse<Data, StandardError>>; So export const getFoo = (options?: SecondParameter<typeof getFooMutator>) => {
return getFooMutator<Bar>({url: `/api/foo`, method: 'GET'}, options);
}; What I really need is something like this (note the additional type parameter in the export const getFoo = (options?: SecondParameter<typeof getFooMutator<Bar>>) => {
return getFooMutator<Bar>({url: `/api/foo`, method: 'GET'}, options);
}; |
Beta Was this translation helpful? Give feedback.
Answered by
hahanein
Sep 3, 2025
Replies: 1 comment
-
Fixed in this issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hahanein
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed in this issue.