AsyncIterable interface: When called, returns an AsyncIterator of type T
Returns an AsyncIter instance yielding the values resulting from the iterator output of the createIterator
function receiving this iterable as an argument.
the result iterator element type
a function receiving the current iterable and returning an iterator of new elements
Applies the values of the current AsyncIter to the given collector
and returns the result.
the collector to apply
Returns an AsyncIter yielding the values of this AsyncIter, followed by the values in each of the iterables supplied as arguments.
a non-empty list of iterables of the same type
Returns an AsyncIter that emits the same elements as this AsyncIter, however only after waiting the given ms
milliseconds before yielding each element.
the amount of milliseconds to delay yielding an element
Returns an AsyncIter that yields each distinct value of this Iter at most once.
Returns an AsyncIter that applies the given keyFun
to each element, and will yield only elements for which keyFun
returns a key that was not calculated before.
the type of key that the key function returns
a function that, given an element and its index, returns a calculated key
Returns an AsyncIter that skips the first given amount of elements of this AsyncIter, then yields all following elements, if present.
the amount of elements to skip
Returs an AsyncIter that skips the last amount
of elements of this AsyncIter.
the amount of last elements to skip
iter.range(0, 10).toAsync().dropLast(5)
result: (0, 1, 2, 3, 4)
Returns an AsyncIter that yields elements from this Iter, only when the element is different from the previous value.
Returns an AsyncIter that yields those elements that satify the given pred
predicate.
a function that take the current element, and the optional previous element and returns a boolean indicating its filter status
Returns an AsyncIter that yields all values from the iterables resulting from applying the given flatMapFun to each element in this AsyncIter.
the elements of the Iterables resulting from flatMapFun
a function taking an element from this Iter and returning an iterable with elements of type R
Applies the given effect function to each element of the AsyncIter, with its index. Note: eagerly gets all values from the iterable.
a function taking an element of the Iter and optionally its index and performs some side-effect.
Returns an AsyncIter with the indices of the this AsyncIter where the element equals the given elem
value.
the element to compare to
Returns an AsyncIter that repeatedly yields one value of this Iter and then one value from each given iterable, as long as none of the iterables is done.
a non-empty list of iterables to interleave with.
Returns an AsyncIter that repeatedly yields one value of this Iter and then one value from each given iterable, for each iterable as long as it still yields values.
a non-empty list of iterables to interleave with.
Returns an AsyncIter that indefinitely yields one value of this Iter and then one value from each given iterable, starting back at the start of each iterable if it is exhausted.
a non-empty list of iterables to interleave with.
Returns an AsyncIter that yields the elements of this AsyncIter with the given interIter elements as a sepatator
an iterator of elements that is used as a separator
Returns a promise resolving to a string starting with the given start element, then each element of this Iter separated by the given sep element, and ending with the end element.
the seperator string
the start string
the end string
Returns an AsyncIter where the given mapFun is applied to each yielded element, with its index.
the result type of the given mapFun
a function taking an element of this Iter, and optionally its index, and returning a new element of type R
Returns an AsyncIter that starts with the startIter elements, then yields all elements of this AsyncIter with the sepIter elements as separators, and ends with the endIter elements.
the start elements
the separator elements
the end elements
Allows side-effects at any point in the chain, but does not modify the Iter.
a tag that can be used when performing the side-effect
the side-effect to perform for each yielded element
iter.nats.toAsync().monitor("nats").take(3)
result:
> nats[0]: 0
> nats[1]: 1
> nats[2]: 2
Returns an AsyncIter where at the given index
, the given amount
of elements is skipped,
and the optional insert
function is called to generate an iterable based on the matching element and its index, after
which that iterable is yielded.
the index at which to patch
the number of elements to skip when a matching element is found
an optional function taking the matching element and its index, and returning an iterable to yield
Returns an AsyncIter where for each element of this Iter that equals the given elem
, the given amount
of elements is skipped,
and the optional insert
iterable is yielded.
the element to patch
the number of elements to skip when a matching element is found
an optional function taking the matching element and its index, and returning an iterable to yield
an optional amount of elements to patch
Returns an AsyncIter where for each element of this Iter that satisfies pred
, the given amount
of elements is skipped,
and the optional insert
function is called to generate an iterable based on the matching element and its index, after
which that iterable is yielded.
a predicate for an element of this Iter and its index
the number of elements to skip when a matching element is found
an optional function taking the matching element and its index, and returning an iterable to yield
the optional amount of times to perform the patch
Returns a promise resolving to the result of applying the reducer function to each element of this AsyncIter, or returns the otherwise value if this Iter is empty.
the reducer function taking the current reducer value and the next element of this AsyncIter, and returning a new value
specifies how to deal with the potential case that this Iter is empty. There are three cases:
f()
Repeats the current AsyncIter times
amount of times, or indefinately if times
is undefined.
the amount of times to repeat this Iter
Returns an AsyncIter that yields only each given nth
value of this AsyncIter.
the amount of elements to skip every in between emissions.
Returns an AsyncIter that yields the items of this AsyncIter starting at the from index, and then yields the specified amount of items, if present.
the index at which to start yielding values
the amount of items to yield
Returns an AsyncIter that yields arrays of the given size of values from this AsyncIter, each shifted that the given step Note: the last window may be smaller than the given size.
the window size
the amount of elements to shift the next window
Returns an AsyncIter that yields arrays of values of this AsyncIter each time a value that equals given elem is encountered
the element on which a new split should be made
Returns an AsyncIter that yields the first given amount of elements of this AsyncIter if present, then ends.
the amount of elements to yield
Returs an AsyncIter that yields the last amount
of elements of this AsyncIter.
the amount of elements to yield
iter.range(0, 10).toAsync().takeLast(3)
result: (7, 8, 9)
Returns a fixed tag string to void unnecessary evaluation of iterable items.
Returns an AsyncIter yielding tuples of each next element of this AsyncIter and the provided iterables. If any of the iterables is done, the resulting AsyncIter will end. Note that the type of the first iterable is taken into account, the other iterable elements will be case to any.
the type of the Iter elements of the first given iterable
the other iterables to zip
Returns an AsyncIter containing tuples of each next element of this AsyncIter and the provided iterables. If any of the iterables is done, the resulting values will be undefined. If all iterables are done, the resulting Iter ends. Note that the type of the first iterable is taken into account, the other iterable elements will be case to any.
the type of the Iter elements of the first given iterable
the other iterables to zip
Returns an AsyncIter yielding the result from applying the given zipFun to the next element of this AsyncIter and each next element of the given iterables. If any of the iterables is done, the element will be undefined. If all iterables are done, the resulting AsyncIter ends. Note that the type of the first iterable is taken into account, however the other iterable elements will be cast to any.
the type of the iterable elements of the first given iterable
the result of applying the zipFun function to the next elements of all given iterables
a function taking one element from this and the given iterables, and returns a resulting element that will be yielded, accepting undefined for each non-present value
the other iterables to zip
Returns an AsyncIter yielding the result from applying the given zipFun to the next element of this AsyncIter and each next element of the given iterables. If any of the iterables is done, the resulting AsyncIter als ends. Note that the type of the first iterable is taken into account, however the other iterable elements will be cast to any.
the type of the Iter elements of the first given iterable
the result of applying the zipFun function to the next elements of all given iterables
a function taking one element from this and the given iterables, and returns a resulting element that will be yielded
the other iterables to zip
Returns an AsyncIter yielding tuples of the elements of this AsyncIter as first elements, and their indices as second element.
Returns an AsyncIter yielding items from an iterable
The type of elements the Iterable yields.
the source iterable
Generated using TypeDoc
Enrichment class allowing for manipulation of asynchronous iterables.
the element type.