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

Support windowed function #863

Open
T3sT3ro opened this issue Dec 2, 2024 · 2 comments
Open

Support windowed function #863

T3sT3ro opened this issue Dec 2, 2024 · 2 comments

Comments

@T3sT3ro
Copy link
Contributor

T3sT3ro commented Dec 2, 2024

Kotlin has windowed function which is a huge helper. It creates an interleaved windows from a collection for example:

[1,2,3,4,5].windowed(2) -> [[1,2], [2,3], [3,4], [4,5]].

It has also useful parameters for step size determining the shift of the window and partial sindows determining if leftover windows from the end which are of different size should also be returned.

It is immensely useful when items have to be compared sequentially in pairs/triplets etc. I miss it very much in lodash, so I hope this library could implement it at least. What do you think of it?

@raon0211
Copy link
Collaborator

raon0211 commented Dec 3, 2024

I think it would be very helpful. Could you open a pull request for this feature?

@T3sT3ro
Copy link
Contributor Author

T3sT3ro commented Dec 3, 2024

I can try, although it must wait until Friday 👍

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

2 participants