Note: If the iterator is infinite, be sure to provide limits via the options.
// Return maximum five items constdata = awaittoArray(iterable, { limit:5 }); // Return results for a maximum of 5 seconds constdata = awaittoArray(iterable, { elapsed:5000 });
Note that limits are ORed, toArray will finish if either of them is true.
Returns an array of values from an iterator.
Note: If the iterator is infinite, be sure to provide limits via the options.
Note that limits are ORed,
toArray
will finish if either of them is true.