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

x/stream_observables/mod.ts>takeWhile

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

Returns a Transform that emits items from the original observable until f returns false.

Parameters

f: (v: T) => boolean

Function called with each emitted item. If it returns true, the item is emitted. Otherwise the item is discarded and no more items are emitted.

Returns

Transform that emits some items from the original observable.