Skip to main content

Module: Application

Type Aliases

ReturnTypes

Ƭ ReturnTypes<Functions, Returns>: Functions["length"] extends 0 ? Returns : Functions extends [infer Function, ...(infer Rest extends VariadicFunction[])] ? ReturnTypes<Rest, [...Returns, ReturnType<Function>]> : never

ReturnType utility for multiple functions.

Type parameters

NameType
Functionsextends VariadicFunction[]
Returnsextends any[] = []

Functions

apply

apply<Functions>(...functions): (...args: Parameters<Functions[0]>) => ReturnTypes<Functions>

Applies all functions on curried arguments and returns an array of results.

Type parameters

NameType
Functionsextends VariadicFunction[]

Parameters

NameType
...functionsFunctions

Returns

fn

▸ (...args): ReturnTypes<Functions>

Parameters
NameType
...argsParameters<Functions[0]>
Returns

ReturnTypes<Functions>