-
Notifications
You must be signed in to change notification settings - Fork 623
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(collections): support Iterable
argument in slidingWindows()
#5916
Conversation
15642f9
to
2bc1f69
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5916 +/- ##
=======================================
Coverage 96.25% 96.26%
=======================================
Files 489 489
Lines 39457 39499 +42
Branches 5824 5839 +15
=======================================
+ Hits 37980 38022 +42
Misses 1433 1433
Partials 44 44 ☔ View full report in Codecov by Sentry. |
Iterable
input in slidingWindows()
Iterable
argument in slidingWindows()
On second thought, Added comment to the tracking issue to discuss |
Will make a new pr instead of modifying this one with the new approach to adding unstable apis |
Support
Iterable
for collectionsslidingWindows
Maintains the current sliding windows for Arrays for the empty Array case. Using the iterable version would change the output from an empty array causing the case is covered by the "slidingWindows() handles empty Array" test to fail.
Example:
If the array specific implementation was removed, this would become a breaking change
With an infinite iterator this function would never return.
I added a
maxWindows
option that limits the number of windows created which would be useful to prevent that case. (maybe it should throw instead?)However I can remove if we think a seperate
take
function is betteror the onus is on the user
e.g
#5470