data-interchange
Version:
Data interchange handler & DB fallback handler
9 lines (8 loc) • 433 B
TypeScript
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>;