Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 703 Bytes

faastjs.async.md

File metadata and controls

18 lines (13 loc) · 703 Bytes
id title hide_title
faastjs.async
Async type
true

faastjs > Async

Async type

Async<T> maps regular values to Promises and Iterators to AsyncIterators, If T is already a Promise or an AsyncIterator, it remains the same. This type is used to infer the return value of cloud functions from the types of the functions in the user's input module.

Signature:

export type Async<T> = T extends AsyncGenerator<infer R> ? AsyncGenerator<R> : T extends Generator<infer R> ? AsyncGenerator<R> : T extends Promise<infer R> ? Promise<R> : Promise<T>;