UNPKG

@rxjs-ninja/rxjs-array

Version:

Operators for RxJS for filtering with boolean logic

24 lines (23 loc) 662 B
/** * @packageDocumentation * @module Array */ import { OperatorFunction } from 'rxjs'; /** * Returns an Observable that emits an array taking a source array and randomly shuffling the elements * * @category Modify * * @typeParam T Item type contained in the Array or Set * * @example * Return a randomly shuffled array * ```ts * const input = [1, 2, 3, 4, 5, 6]; * of(input).pipe(shuffle()).subscribe(); * ``` * Output: `[4, 2, 5, 1, 6, 3]` * * @returns Observable that emits an array of values shuffled from the source array */ export declare function shuffle<T extends unknown>(): OperatorFunction<Iterable<T>, T[]>;