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

skipTake #1237

Closed
char0n opened this issue Dec 24, 2019 · 1 comment
Closed

skipTake #1237

char0n opened this issue Dec 24, 2019 · 1 comment

Comments

@char0n
Copy link
Owner

char0n commented Dec 24, 2019

Is your feature request related to a problem? Please describe.

When given a number n and an array, returns an array containing every nth element

R.addIndex(R.takeWhile) with specialized predicate can be used to implement this function.

Describe the solution you'd like

skipTake(2, [1,2,3,4]);
//=> [1, 3]

skipTake(3, _.range(20));
//=> [0, 3, 6, 9, 12, 15, 18]

Describe alternatives you've considered

I've considered R.takeWhile, but doesn't exactly do what we want without specialized composition.

Additional context
Add any other context or screenshots about the feature request here.

@damiangreen
Copy link
Contributor

I've got a working implementation of this. I can create a PR once I've created tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants