reconbot/streaming-iterables

Suggested additions to the "swiss army knife"

wellcaffeinated opened this issue · 0 comments

Here are some functions i think would be great to add to the library:

  • dropLast(n): buffer the last n values and once the iterator completes, drop them. Release the rest on the fly.
  • dropWhile(predicate): skip values until predicate(value) returns true
  • enumerate: maps input value to [index, value]
  • find(predicate): drops values until predicate(value) returns true, then yields that single value and ends
  • nth(n): drops values until the nth value is reached then yields that single value and ends

Additions for higher order functionality:

  • zip( iterators[] ): normal zip functionality. yields arrays containing values from each iterator until all iterators end.