Index
Type aliases
Type aliases
Compose
Type parameters
returns
Function
example
import {F} from 'ts-toolbelt'
/// If you are looking for creating types for `compose`
/// `Composer` will check for input & `Compose` the output
declare function compose<Fns extends F.Function[]>(...args: F.Composer<Fns>): F.Compose<Fns>
const a = (a1: number) => `${a1}`
const c = (c1: string[]) => [c1]
const b = (b1: string) => [b1]
compose(c, b, a)(42)
/// And if you are looking for an async `pipe` type
declare function compose<Fns extends F.Function[]>(...args: F.Composer<Fns, 'async'>): F.Composer<Fns, 'async'>
const a = async (a1: number) => `${a1}`
const b = async (b1: string) => [b1]
const c = async (c1: string[]) => [c1]
await compose(c, b, a)(42)
ComposeFnAsync
Type parameters
- Fns: Function[]
- K: keyof Fns
ComposeFnSync
Type parameters
- Fns: Function[]
- K: keyof Fns
Composer
Compute what the input of Compose
should be
Type parameters
example
Compose
Function
s together