GraphReFlyTS

API Reference

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

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

Signature

function sample(): Operator<unknown, S>

Returns

A Operator<unknown, S> value.

Example

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

Source

packages/ts/src/graph/combinators.ts