3 ms·
do you really want to keep util.promisifying everything? I know I don't. Streams (and event emitters, and the ecosystem bits that rely on them) still haven't f
by spion 6y ago
do you really want to keep util.promisifying everything? I know I don't.
Streams (and event emitters, and the ecosystem bits that rely on them) still haven't fully caught up with promises either, e.g. async iterators and generators are still quite awkward
- prussian 6y agolate reply. I've sort of experimented with async iterators and using pipeline() to pipe them together and it seems to work out for the most part; not sure what is awkward about them, I mean consume with an async iter on the source passed as an arg and you can throw at any time to kill it with an error. In fact I find the new async generator transforms easier and more ergonomic. in terms of event emitters. I can just use `await once(emiter, 'event');` now. Not sure how .on would be expected to work outside of it being some kind of async iterator. I mean, I don't mind using util.promisify or just importing the "to be" xyz/promises paths. The code exists clearly, either behind a symbol or otherwise.
- spion 6y agoCompare with the Dart stream API: https://api.dart.dev/stable/2.12.2/dart-async/Stream-class.html https://api.dart.dev/stable/2.12.2/dart-async/Stream-class.h...