Skip to content
PACKAGES

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 { bufferTime } from "@graphrefly/ts/operators";
function bufferTime(
source: Node<S>,
ms: number,
): Node<S[]>
ParameterTypeDescription
sourceNode<S>Source node that provides graph-visible input.
msnumberDuration or timestamp in milliseconds.

A Node<S[]> value.

import { bufferTime } from "@graphrefly/ts/operators";

packages/ts/src/graph/time.ts