sample()
sample: emit the source’s (dep 0) most recent value each time the notifier (dep 1) delivers DATA.
partial:true + ctx.state. The notifier completing completes the operator; the source completing
stops sampling (clears the held value); an ERROR from either terminates.
completeWhenDepsComplete:false + errorWhenDepsError:false + terminalAsRealInput:true (manual
terminal handling). No flush of the held value on source COMPLETE (RxJS sample semantics).
Import
Section titled “Import”import { sample } from "@graphrefly/ts/operators";Signature
Section titled “Signature”function sample(): Operator<unknown, S>Returns
Section titled “Returns”A Operator<unknown, S> value.
Example
Section titled “Example”import { sample } from "@graphrefly/ts/operators";Source
Section titled “Source”packages/ts/src/graph/combinators.ts