Skip to main content

Function: _async()

function _async<A, R>(fn): (...args) => Promise<R>;

Tricks the TS compiler into thinking that a model flow generator function can be awaited (is a promise).

Type Parameters​

Type ParameterDescription
A extends any[]Function arguments.
RReturn value.

Parameters​

ParameterTypeDescription
fn(...args) => Generator<any, R, any>Flow function.

Returns​

(...args) => Promise<R>