-
Notifications
You must be signed in to change notification settings - Fork 19
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 for other types that implement Symbol.iterator #7
Comments
Thanks for the issue! Yeah being able to use other JS iterable objects should be nice. At the beginning I just wanted to keep it simple, as a replacement for ES5 Array methods. What do you think about it? Does it make sense to you, for example, using Releasing a version 2.0.0 changing the API is also an option I've been thinking about. |
I think most methods would make sense for most supported data-types.
I'm sure there are some cases where it doesn't make sense at all, but people often have strange use-cases. Especially map and forEach make sense for almost everything. The reason I opened the issue is because I wanted to use the library to iterate over a Map like this:
If you think about releasing a version 2.0, maybe it would also be a nice idea to switch the order of function and data to data last like lodash/fp does it. That way it would be very easy to partially apply a function for later use.
|
Thanks for your opinion and sorry for the super late reply. I think that definitely I'll make it compatible with the rest of types.
This looks good but I would add it as an option (similar to lodash/fp), because I think that that order would be unfamiliar to most of the people. |
Hi!
Would be a super awesome feature if the library would also support types other than plain Arrays that implement Symbol.iterator. If the library would use for ... of internally this could be fairly easy to implement for most methods.
The text was updated successfully, but these errors were encountered: