@jiminp/tooltool
    Preparing search index...

    Interface AsyncGeneratorExecutor<Y, R, T>

    Callback interface for controlling async generator execution.

    Provides three methods to control the generator's behavior:

    • yeet - Yield a value from the generator
    • done - Complete the generator with a final return value
    • fail - Throw an error from the generator
    const executor = (callbacks: AsyncGeneratorExecutor<number, string>) => {
    callbacks.yeet(1);
    callbacks.yeet(2);
    callbacks.done("completed");
    };
    interface AsyncGeneratorExecutor<Y, R = void, T = unknown> {
        done(r: R): void;
        fail(t: T): void;
        yeet(y: Y): void;
    }

    Type Parameters

    • Y

      The type of yielded values

    • R = void

      The type of the return value

    • T = unknown

      The type of thrown values/errors (default: unknown)

    Index

    Methods

    Methods

    • Completes the generator with a return value.

      Parameters

      • r: R

        The final return value

      Returns void

    • Throws an error from the generator.

      Parameters

      • t: T

        The error or value to throw

      Returns void

    • Yields a value from the generator.

      Parameters

      • y: Y

        The value to yield

      Returns void