News for hackers. Stuff that matters.
Re:The triple dot syntax (` `) in JavaScript: rest vs. spread by ericlewis on Sunday May 08, 2022 @03:44PM (#31307480)
I’ve never heard anyone argue for callbacks. But the async/await problem isn’t entirely dead since folks still argue generators should be doing they job. They’re similar flavors of cooperative multitasking I guess. But callbacks.. they’re really hard to test without abusing entirely different parts of js. Not that promises are much better.
Re:The triple dot syntax (` `) in JavaScript: rest vs. spread by klabb3 on Sunday May 08, 2022 @05:38PM (#31308367)
Yes, but async await isn't really complete without good support for streaming ops and APIs that support them first class. That includes merging streams, canceling them, etc (kinda like Rx). It probably needs both push and pull streams as well. We're not there yet, so in the meantime we have to use events and event listeners, in addition to async/await. I think that's perfectly fine.
Re:The triple dot syntax (` `) in JavaScript: rest vs. spread by michaelsbradley on Monday May 09, 2022 @04:40AM (#31311871)
Have you tried Ix as a complement to Rx?

https://github.com/ReactiveX/IxJS

Re:The triple dot syntax (` `) in JavaScript: rest vs. spread by klabb3 on Monday May 09, 2022 @09:02AM (#31313510)
No I have not, I prefer to go lightweight so good old event listeners are perfectly fine for my purposes. But once you have ubiquitous first class support for async iterables and so on I'm all aboard. I see Rx very much like an experiment that should influence language features and std libs, rather than a standalone framework.