Function go

  • Executes a coroutine immediately up to its next yield point. If the coroutine yields a signal, suspends execution until the signal emits.

    Parameters

    • generator: Generator<any, any, any> | GeneratorFunction

      Generator function to call or generator instance to resume

    • Optional value: any = undefined

      Optional value to pass to the generator's next() method

    Returns Generator<any, any, any>

    The running generator instance

    Throws

    If the yielded value cannot be converted to a signal