We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
F.MapAwaitedReturnType
F.MapReturnType works correctly but it does not apply on async functions. I suggest creating a F.MapAwaitedReturnType function:
F.MapReturnType
export type MapAwaitedReturnType< FN extends Fn | unset | _ = unset, ASYNC_FUNCTION extends ((...args: any[]) => Promise<any>) | _ | unset = unset, > = PartialApply<MapAwaitedReturnTypeFn, [FN, ASYNC_FUNCTION]> interface MapAwaitedReturnTypeFn extends Fn { return: this['args'] extends [infer FN extends Fn, infer ASYNC_FUNCTION] ? ASYNC_FUNCTION extends (...params: infer PARAMS) => Promise<infer RETURN_TYPE> ? (...params: PARAMS) => Promise<Call<FN, RETURN_TYPE>> : never : never }
@gvergnaud I can create the PR if you want!
The text was updated successfully, but these errors were encountered:
I think I'd prefer having a Promises module that has a map function:
type X = H.Functions.MapReturnType<H.Promises.Map<Fn>>
That seems more powerful because Promises.Map could be composed in other ways too. WDYT?
Sorry, something went wrong.
Yes, I agree 👍
No branches or pull requests
F.MapReturnType
works correctly but it does not apply on async functions. I suggest creating aF.MapAwaitedReturnType
function:@gvergnaud I can create the PR if you want!
The text was updated successfully, but these errors were encountered: