takeWhile
import { takeWhile } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/iterable.ts";Take elements from an Iterable while a predicate is satisfied. Stops at the first element that doesn't satisfy the predicate.
@example
import * as I from "./iterable.ts";
const numbers = I.wrap(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
const whileLessThanFive = I.takeWhile((n: number) => n < 5)(numbers);
const result = Array.from(whileLessThanFive); // [1, 2, 3, 4]