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
Section titled “Import”import { withLatestFrom } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function withLatestFrom(): Operator<unknown, readonly [A, B]>Returns
Section titled “Returns”A Operator<unknown, readonly [A, B]> value.
Example
Section titled “Example”import { withLatestFrom } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/combinators.ts