Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/stream_observables/mod.ts>sample

A collection of observables built with ReadableStreams & friends.
Latest
function sample
import { sample } from "https://deno.land/x/stream_observables@v1.3/mod.ts";

Emits the most recently emitted value from the Observable whenever the notifier emits. If no new value has been emitted from the source observable since the last time the notifier emitted, nothing will be emitted.

Parameters

notifier: Observable<unknown>

Observable that triggers the sampling of the source observable.

Returns

Transform that emits whenever the notifier emits, provided the source observable has emitted a new value in the mean time.