itertools-ts icon indicating copy to clipboard operation
itertools-ts copied to clipboard

Implement transform.distribute()

Open Smoren opened this issue 1 year ago • 0 comments

Distribute the elements of the iterable evenly into n smaller iterables. Ex: ([1, 2, 3, 4], 2) => [1, 3], [2, 4]

function *distribute<T>(data: Iterable<T> | Iterator<T>, n: number): Iterable<Array<T>>

Needs to be implemented:

  • transform.distribute()
  • transform.distributeAsync()
  • Stream.distribute()
  • AsyncStream.distribute()

Smoren avatar Feb 09 '25 12:02 Smoren