@jiminp/tooltool
    Preparing search index...

    Function isAsyncIterable

    • Type guard to check if an iterable is an async iterable.

      Determines whether the given iterable implements the async iterator protocol by checking for the presence of the Symbol.asyncIterator method.

      Type Parameters

      • T

        The type of values in the iterable

      • TReturn

        The type of the return value (default: any)

      • TNext

        The type of values that can be passed to next() (default: undefined)

      Parameters

      Returns it is AsyncIterable<T, TReturn, TNext>

      true if the iterable is async, false otherwise

      const syncGen = function* () { yield 1; }();
      const asyncGen = async function* () { yield 1; }();

      isAsyncIterable(syncGen); // false
      isAsyncIterable(asyncGen); // true