1.0.5 • Published 1 year ago

@rbxts/lazy-iterator v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

LazyIterator

Combines multiple array operations into an iterator and only applies operations when the iterator is processed

Example

import LazyIterator from "@rbxts/lazy-iterator";

const sum = LazyIterator.fromArray([1,2,3,4,5,6,7,8])
  .map(n => n * 3) // triple all numbers
  .filter(n => n % 2 === 0) // filter out odd numbers
  .reduce((sum, n) => sum + n); // apply all operations then add up all numbers

print(sum); // 60
1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago