Transducer. Creates internal sliding window of n values and performs maxSwaps random shuffle operations for each new value and yields values in shuffled order. By default maxSwaps is the same as the chosen chunk size.
n
maxSwaps
[...streamShuffle(5, range(10))] // [ 3, 2, 5, 0, 8, 7, 1, 6, 4, 9 ]
sliding window size
number of swaps per input
Generated using TypeDoc
Transducer. Creates internal sliding window of
n
values and performsmaxSwaps
random shuffle operations for each new value and yields values in shuffled order. By defaultmaxSwaps
is the same as the chosen chunk size.[...streamShuffle(5, range(10))] // [ 3, 2, 5, 0, 8, 7, 1, 6, 4, 9 ]