API Reference
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
import { bufferTime } from "@graphrefly/ts/operators";
Signature
function bufferTime(
source: Node<S>,
ms: number,
): Node<S[]>
Parameters
| Parameter | Type | Description |
|---|---|---|
source | Node<S> | Source node that provides graph-visible input. |
ms | number | Duration or timestamp in milliseconds. |
Returns
A Node<S[]> value.
Example
import { bufferTime } from "@graphrefly/ts/operators";
Source
packages/ts/src/graph/time.ts