Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EnhancedAsyncGenerator<T, TReturn, TNext>

Type parameters

  • T

  • TReturn

  • TNext

Hierarchy

  • Enhancements<T, TReturn, TNext, Async>
    • EnhancedAsyncGenerator

Implements

  • AsyncGenerator<T, TReturn, TNext>
  • AsyncIterable<T>
  • AsyncIterator<T>

Index

Properties

Abstract _impl

Optional returning

returning: any

Methods

Abstract [Symbol.asyncIterator]

asArray

  • asArray(): ReturnValue<T[], Async>

concat

every

  • every(p: IndexedPredicate<T>, thisArg?: any): ReturnValue<boolean, Async>
  • Returns false and terminates this generator if the predicate is false for any of the generator's yielded values.

    If the generator terminates without having failed the predicate, true is returned.

    Parameters

    • p: IndexedPredicate<T>

      predicate to apply to each yielded value.

    • Optional thisArg: any

      Optional value to supply as context (this) for the predicate

    Returns ReturnValue<boolean, Async>

filter

flat

  • Flatten the values yielded by this generator to level depth. Produces a generator that yields the individual values at each level in depth-first order. Any iterable (including Array) or iterator will be traversed and its values yielded.

    The return type is currently over-broad

    Type parameters

    • D: number

    Parameters

    • Default value depth: D = 1 as D

      (default = 1)

    Returns Enhanced<Async, FlatGen<T, D>>

flatMap

  • flatMap<D>(f: IndexedFn<T, FlatGen<T, D>, Async>, depth?: D): Enhanced<Async, FlatGen<T, D>>
  • Flatten the values yielded by applying the function to the values yielded by the generator to level depth. Produces a generator that yields the individual values at each level in depth-first order. Any iterable (including Array) or iterator will be traversed and its values yielded.

    The return type is currently over-broad

    Type parameters

    • D: number

    Parameters

    • f: IndexedFn<T, FlatGen<T, D>, Async>
    • Default value depth: D = 1 as D

    Returns Enhanced<Async, FlatGen<T, D>>

forEach

  • forEach(f: IndexedFn<T, void, Async>, thisArg?: any): void
  • Operate on each value produced by this generator. f is called with two values, the value yielded by this generator and a sequential index.

    Parameters

    • f: IndexedFn<T, void, Async>
    • Optional thisArg: any

      Value to be supplied as context this for function f.

    Returns void

join

  • join(sep?: undefined | string): ReturnValue<string, Async>

limit

map

  • Apply the function to each value yielded by this generator. It is called with two arguments, the value yielded, and a sequential index. The return value is a generator that yields the values produced by the function.

    Type parameters

    • V

    Parameters

    • f: IndexedFn<T, V, Async>
    • Optional thisArg: any

      Optional value to be supplied as context this for function f.

    Returns Enhanced<V, Async>

Abstract next

  • next(): GenIteratorResult<T, TReturn, Async>

reduce

repeat

  • repeat<N>(value: N, repetitions?: number): Enhanced<T | N, Async>
  • Returns a new generator that repeats the supplied value after this generator completes.

    Type parameters

    • N

    Parameters

    • value: N

      the value to repeat

    • Default value repetitions: number = Number.POSITIVE_INFINITY

      The number repetitions; the default is infinite.

    Returns Enhanced<T | N, Async>

repeatLast

Abstract return

  • return(value: any): GenIteratorResult<T, TReturn, Async>

slice

some

  • some<T>(p: IndexedPredicate<T, Async>, thisArg?: any): ReturnValue<boolean, Async>
  • Returns true and terminates the generator if the predicate is true for any of the generator's yielded values.

    If the generator terminates without having satisfied the predicate, false is returned.

    Type parameters

    • T

    Parameters

    • p: IndexedPredicate<T, Async>

      predicate to apply to each yielded value.

    • Optional thisArg: any

      Optional value to supply as context (this) for the predicate

    Returns ReturnValue<boolean, Async>

Abstract throw

  • throw(e: any): GenIteratorResult<T, TReturn, Async>

zip

Generated using TypeDoc