GraphReFlyTS

API Reference

withLatestFrom()

withLatestFrom: on each PRIMARY (dep 0) value, emit [primary, latestSecondary]; a secondary-only (dep 1) wave updates the cached secondary but emits nothing. Uses the DEFAULT first-run gate (partial:false), NOT partial — the frozen reference's Phase 10.5 W1 fix: with partial:true the primary's push-on-subscribe fires the fn BEFORE the secondary has delivered, so the initial pair is dropped. The gate holds the first run until BOTH deps settle, then fires once with both populated; subsequent waves are gate-free and fire on primary-alone. Completes when the PRIMARY completes (not the secondary) — completeWhenDepsComplete:false + terminalAsRealInput:true with a primary-terminal check; a secondary terminal is ignored (its last value persists).

Import

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

Signature

function withLatestFrom(): Operator<unknown, readonly [A, B]>

Returns

A Operator<unknown, readonly [A, B]> value.

Example

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

Source

packages/ts/src/graph/combinators.ts