Function _async

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

    Type Parameters

    • A extends any[]
    • R

    Parameters

    • fn: ((...args) => Generator<any, R, any>)

      Flow function.

        • (...args): Generator<any, R, any>
        • Parameters

          • Rest ...args: A

          Returns Generator<any, R, any>

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

      • (...args): Promise<R>
      • Parameters

        • Rest ...args: A

        Returns Promise<R>

    Typeparam

    A Function arguments.

    Typeparam

    R Return value.