@lumino/algorithm
Version:
Lumino Algorithms and Iterators
41 lines (40 loc) • 923 B
TypeScript
/**
* Create an iterator which repeats a value a number of times.
*
* @deprecated
*
* @param value - The value to repeat.
*
* @param count - The number of times to repeat the value.
*
* @returns A new iterator which repeats the specified value.
*
* #### Example
* ```typescript
* import { repeat } from '@lumino/algorithm';
*
* let stream = repeat(7, 3);
*
* Array.from(stream); // [7, 7, 7]
* ```
*/
export declare function repeat<T>(value: T, count: number): IterableIterator<T>;
/**
* Create an iterator which yields a value a single time.
*
* @deprecated
*
* @param value - The value to wrap in an iterator.
*
* @returns A new iterator which yields the value a single time.
*
* #### Example
* ```typescript
* import { once } from '@lumino/algorithm';
*
* let stream = once(7);
*
* Array.from(stream); // [7]
* ```
*/
export declare function once<T>(value: T): IterableIterator<T>;