deltasAsync
deltasAsync<
T,D>(iterable,subtract):AsyncIterableIterator<D>
Defined in: packages/core/src/iterable/async/deltas.ts:17
Yields the difference between each element and the one before it.
The async counterpart of deltas. subtract is required rather than
defaulting to numeric subtraction, and receives (current, previous).
Time complexity: O(1) per element, plus whatever subtract costs.
Type Parameters
Section titled “Type Parameters”T
D
Parameters
Section titled “Parameters”iterable
Section titled “iterable”The input iterable, sync or async.
subtract
Section titled “subtract”MaybeAsyncCallable<[T, T], D>
Computes the difference between an element and its predecessor.
Returns
Section titled “Returns”AsyncIterableIterator<D>
An iterator over the consecutive differences.