UNPKG

data-interchange

Version:
9 lines (8 loc) 433 B
export declare const BOOMERANG_RETURN: unique symbol; /** * Iterate over an array and return when a certain point is met * - Asynchronously iterate over an array of items until the * return symbol is returned, which causes the boomerang to * walk backwards over the list again */ export declare function boomerang<B>(arr: Array<B>, cb: (item: B, index: number, backwards?: boolean) => Promise<void | Symbol>): Promise<void>;