You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I've used ES6 iterators more, I've come to like them more than arrays for their flexibility. (not to mention you can easily use Array.from() if you want an array)
I'm pretty sure this would be a breaking change. (so planned for 2.x)
Copied from original issue: makojs/tree#30
The text was updated successfully, but these errors were encountered:
Arrays are already iterable, so the 2nd example is already possible :) In fact, almost everything is iterable. Strings, TypedArrays, function arguments, even those damn NodeLists.
The only thing that you actually need to make iterable are objects. So maybe this:
Haha, funny you should bring that up, I started doing that in what I was working on tonight.
Even still, I like to think that I can save on some performance/memory if I'm able to avoid buffering the entire collection with Array.from() before returning, especially since graph.js uses iterators as well.
dominicbarnes
changed the title
Use more ES6 iterators in the API
tree: use more ES6 iterators in the API
Jul 1, 2017
From @dominicbarnes on October 15, 2016 5:57
As I've used ES6 iterators more, I've come to like them more than arrays for their flexibility. (not to mention you can easily use
Array.from()
if you want an array)I'm pretty sure this would be a breaking change. (so planned for 2.x)
Copied from original issue: makojs/tree#30
The text was updated successfully, but these errors were encountered: