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

Add cycle function #78

Closed
Tracked by #59
ppeeou opened this issue Dec 14, 2021 · 0 comments · Fixed by #95
Closed
Tracked by #59

Add cycle function #78

ppeeou opened this issue Dec 14, 2021 · 0 comments · Fixed by #95
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ppeeou
Copy link
Member

ppeeou commented Dec 14, 2021

Suggestion

⭐ Suggestion

ref https://docs.python.org/3/library/itertools.html#itertools.cycle

💻 Use Cases

const iter = cycle("abc")
iter.next(); // {value:"a", done: false}
iter.next(); // {value:"b", done: false}
iter.next(); // {value:"c", done: false}
iter.next(); // {value:"a", done: false}
iter.next(); // {value:"b", done: false}

// with pipe
pipe(
  cycle([1,2,3,4]),
  take(5),
  toArray,
); // [1,2,3,4,1]
@ppeeou ppeeou added enhancement New feature or request good first issue Good for newcomers v0.4 labels Dec 14, 2021
@ppeeou ppeeou mentioned this issue Dec 14, 2021
25 tasks
@ppeeou ppeeou self-assigned this Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant