UNPKG

@altostra/core

Version:

Core library for shared types and logic

10 lines (9 loc) 481 B
import type { Predicate } from "../../General"; import type { It } from "../It"; /** * Returns a function that transforms an iterable to an iterable that would complete after a specified \ * predicate returns `true`. * @param completionPredicate A function that return a boolean, that determines if iteration should be \ * completed after yielding the current item */ export declare function completeWhen<T>(completionPredicate: Predicate<T>): (source: Iterable<T>) => It<T>;