Skip to content
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

feat: implement takeWhile and takeLast #283

Merged
merged 2 commits into from
Aug 24, 2022
Merged

Conversation

wellcaffeinated
Copy link
Contributor

Implemented takeWhile and takeLast following the established patterns of the library. Wrote tests and documentation.

takeWhile(predicate) takes results from any iterator until the predicate returns false

takeLast(n) buffers the last n values until the iterator finishes, then iterates through them in order of read

@wellcaffeinated
Copy link
Contributor Author

I suggest that for completeness we probably want to have dropLast and dropWhile next.

@reconbot
Copy link
Owner

Sorry I missed this! @wellcaffeinated this is great, well tested and easy to understand.

@reconbot reconbot changed the title implement takeWhile and takeLast feat: implement takeWhile and takeLast Aug 24, 2022
@reconbot reconbot merged commit ba71461 into reconbot:main Aug 24, 2022
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

Successfully merging this pull request may close these issues.

2 participants