0no-co / wonka

🎩 A tiny but capable push & pull stream library for TypeScript and Flow
MIT License
709 stars 29 forks source link

feat: Implement fromIterable and replace fromArray #115

Closed kitten closed 2 years ago

kitten commented 2 years ago

This implements a new fromIterable function, supporting both iterables (iterators) and async iterables. These will likely become very useful in combination with generators and async generators in JS, as a lot of complex logic can be abstracted using generators, but generators fail at abstracting a couple of complex pieces of logic easily.

I'm currently not sure this is a worthwhile addition. While it does give some performance up (which to be fair, is negligible) it does add a new host of potential features.