The type of the values contained by this sequence.
A cached size for sequences with available size information (eg. sequences made from a
sized iterable, or sequences mapped from an already sized sequence).
Not of much use for AsyncSequences, since most sized iterables are collections, which don't
tend to be asynchronous. Still, a couple cases like Promise<T>[]
are sized.
Remains here mostly for API consistency. Less than 0 for non-deterministically sized
sequences, like FilteringSequences.
The underlying asynchronous iterable contained by this sequence. The values are dispatched through its iterator, so any type implementing the asynciterator symbol or having Promises as their parameterized type is fine.
Returns an asynchronous generator yielding all values contained by this sequence.
ToString tag.
Returns a new AsyncSequence containing the values of this sequence and the one
provided as an argument. This operation is intermediate and stateless.
The created sequence will be sized if and only if both of the concatenated sequences are of
known size. Otherwise, size information is lost.
Returns a promise resolving to true if value
is identical to one contained by this sequence.
This is a short-circuiting terminal operation.
Returns a promise resolving to true if all the values in values
are contained by this
sequence. This is a short-circuiting terminal operation.
If a predicate is provided, returns a promise resolving to the amount of elements in this sequence that fulfilled it. Otherwise, resolved to the the amount of elements in this sequence. This is a terminal operation.
Returns a new AsyncSequence skipping the first n
elements.
This operation is intermediate and stateful.
The sequence created retains size information.
Returns a new AsyncSequence skipping the first n elements that fulfill a given
asynchronous predicate.
This operation is intermediate and stateful.
The sequence created is non-sized.
Returns a promise resolving to the element at index
, or to undefined if the index is out of
bounds. Since AsyncSequences are not a Random Access collection, this operation is
O(n). This is a short-circuiting terminal operation.
Returns a promise resolving to true if all elements in this sequence fulfill the given asynchronous predicate. This is a short-circuiting terminal operation.
Returns a new AsyncSequence keeping the elements in this sequence that fulfill the
given asynchronous predicate.
This operation is intermediate and stateless.
The sequence created is non-sized.
Returns a promise resolving to the first item fulfilling an asynchronous predicate, or to undefined if none does. This is a short-circuiting terminal operation.
Returns a promise resolving to the index of the first item fulfilling an asynchronous predicate, or to -1 if none does. This is a short-circuiting terminal operation.
Returns a promise resolving to the last item fulfilling an asynchronous predicate, or to undefined if none does. This is a terminal operation.
Returns a promise resolving to the index of the last item fulfilling an asynchronous predicate, or to -1 if none does. This is a terminal operation.
Returns a promise resolving to the first element of this sequence, or to undefined if it's empty. This is a short-circuiting terminal operation and it does not hang for infinite sequences.
Returns a new AsyncSequence flattening every sequence generated by the asynchronous
transformator function by one level. This operation is intermediate and stateless.
The sequence created is non-sized.
Returns a new AsyncSequence flattening every inner sequence of this collection by one
level. This operation is intermediate and stateless.
The sequence created is non-sized.
Returns a promise resolving to the value resulting from recursively applying an asynchronous operation on an initial value and the current value for every item of this sequence. This is a terminal operation.
Returns an empty promise performing an asynchronous operation on every item of this sequence. This is a terminal operation.
Groups items in this sequence into a map promise by a key generated by the selector provided.
All items that generate the same key (according to {@link Map.has()} equality) will end up
in the same bucket. This is a terminal operation.
Note: TinyLazySeq is opinionated about grouping algorithms and does not provide a "group to
object" equivalent (this method is equivalent to {@link Map.groupBy()}, and AsyncSequence
does not provide an {@link Object.groupBy()} version). The library developer discourages the
usage of objects as maps, as frequent dynamic addition of keys degrades property access
performance.
Returns a promise resolving to the the index of the first item of this sequence value
is
identical to. If there is none, resolves to -1. This is a short-circuiting terminal operation.
Returns a promise resolving to true if this collection contains no elements. This is a short-circuiting terminal operation and it does not hang for infinite sequences.
Returns a promise resolving to a string representation of this sequence. This is a terminal operation.
Returns a promise resolving to the last element contained by this sequence. This is a terminal operation.
Returns a promise resolving to the index of the last element of this sequence value
is
identical to, or to -1 if none is. This is a terminal operation.
Returns a new AsyncSequence asynchronously transforming each value of this sequence.
This operation is intermediate and stateless.
The sequence created retains size information.
Returns a promise resolving to a value resulting from recursively applying an asynchronous operation on the first element of this sequence and the current value for every item of this sequence after the first. This is a terminal operation.
Returns the size of the iterable wrapped by this sequence if said iterable is a sized collection (by implementing a length or size property). Otherwise, returns a negative number.
If a predicate is provided, returns a promise resolving to true
if at least one element of
this sequence fulfills it. Otherwise, returns a promise resolving to true
if there is at
least one element in this sequence. This is short-circuiting terminal operation.
Returns a new AsyncSequence dropping all elements after the first n
.
This operation is intermediate and stateful.
The sequence created retains size information.
Returns a new AsyncSequence dropping all elements after an asynchronous predicate
stops fulfilling for the first time. This operation is intermediate and stateful.
The sequence created is non-sized.
Returns a promise resolving to an array containing the elements of this sequence. This is a terminal operation.
Returns a string representation of this sequence and its estimated size, which could be one of the following:
Creates an asynchronous lazy sequence containing no elements.
The sequence created is sized (0).
Creates an asynchronous lazy sequence wrapping the provided iterable.
The sequence created is sized if the provided iterable has a length
or size
property.
Otherwise, size is less than 0 (unknown).
Creates an asynchronous lazy sequence whose elements are generated by the recursive
application of nextValue
on initial
until nextValue
returns null
.
The sequence created is non-sized (unknown).
Creates an asynchronous lazy sequence containing the provided arguments.
The sequence created is sized (known).
Generated using TypeDoc
Describes a lazily computed sequence of elements that can be asynchronously iterated over, allowing for composition of intermediate operations in an efficient, on-demand execution order.