UNPKG

callbag-take-while

Version:

👜 Callbag operator which emits values emitted by the source as long as each value satisfies the given predicate, and then completes as soon as predicate is not satisfied.

6 lines (4 loc) • 143 B
import { Source } from 'callbag' export default function takeWhile<I>( predicate: (data: I) => boolean, ): (source: Source<I>) => Source<I>