@nevware21/ts-utils
    Preparing search index...

    Interface IAsyncIterator<T>

    The async iterator returned by an IAsyncIterable, it is compatible with the native AsyncIterator type which is only available when using the ES2018 (or later) lib.

    0.20.0

    interface IAsyncIterator<T = any> {
        next(...args: any[]): Promise<IteratorResult<T, any>>;
        return?(value?: any): Promise<IteratorResult<T, any>>;
        throw?(e?: any): Promise<IteratorResult<T, any>>;
    }

    Type Parameters

    • T = any

      Identifies the type of the values returned by the async iterator

    Index
    • Returns a promise for the next result of the iteration.

      Parameters

      • ...args: any[]

        Optional value to pass to the iterator

      Returns Promise<IteratorResult<T, any>>

    • Optionally signals that the caller has finished with the iterator.

      Parameters

      • Optionalvalue: any

        The value to be returned

      Returns Promise<IteratorResult<T, any>>

    • Optionally signals that the caller has detected an error.

      Parameters

      • Optionale: any

        The error

      Returns Promise<IteratorResult<T, any>>