bufferTime()
bufferTime: buffer source values and flush them as an array every ms (RxJS bufferTime(ms)).
SUBSCRIBE-ARMED: the interval(ms) notifier is a CONSTRUCTION-time dep (arms on subscribe), so an
empty window flushes [] even before the first source value — matching the landed {@link buffer}
(which flushes on every notifier signal). On source COMPLETE the remainder flushes then COMPLETE
(B44), and D62 lets the terminal wave still drain unsubscribeDep(interval) so the helper-owned
interval source deactivates instead of ticking forever.
Import
Section titled “Import”import { bufferTime } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function bufferTime( source: Node<S>, ms: number,): Node<S[]>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
source | Node<S> | Source node that provides graph-visible input. |
ms | number | Duration or timestamp in milliseconds. |
Returns
Section titled “Returns”A Node<S[]> value.
Example
Section titled “Example”import { bufferTime } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/time.ts