8000 Suggested additions to the "swiss army knife" · Issue #284 · reconbot/streaming-iterables · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Suggested additions to the "swiss army knife" #284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wellcaffeinated opened this issue May 4, 2022 · 0 comments
Open

Suggested additions to the "swiss army knife" #284

wellcaffeinated opened this issue May 4, 2022 · 0 comments

Comments

@wellcaffeinated
Copy link
Contributor
wellcaffeinated commented May 4, 2022

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0