UNPKG

@barchart/common-js

Version:
21 lines (20 loc) 712 B
/** * A looping mechanism that allows iteration to continue asynchronously. * * @public * @function * @async * @param {Iterable} iterable * @param {LoopProcessorCallback} processor * @returns {Promise<void>} */ export default function iterate(iterable: Iterable<any>, processor: LoopProcessorCallback): Promise<void>; /** * A callback used to process a single item (taken from the iterable object). */ export type LoopProcessorCallback = (item: any, callback: LoopContinueCallback) => any; /** * A callback which is invoked to indicate item processing is complete and loop * should continue processing (with the next item from the iterable object). */ export type LoopContinueCallback = () => any;