UNPKG

643 BJavaScriptView Raw
1import { of } from './of';
2import { RepeatIterable } from './operators/repeat';
3/**
4 * Repeats a given value for the specified number of times as an iterable.
5 *
6 * @export
7 * @template TSource The type of element to repeat.
8 * @param {TSource} value The value to repeat as an iterable.
9 * @param {number} [count=-1] The number of times to repeat the value, infinite if not specified.
10 * @returns {AsyncIterableX<TSource>} An iterable with a single item that is repeated over the specified times.
11 */
12export function repeatValue(value, count = -1) {
13 return new RepeatIterable(of(value), count);
14}
15
16//# sourceMappingURL=repeatvalue.mjs.map