3 ms·
This is what observables are all about, yet `rxjs` and the like never gained any wide spread traction, despite solving so many of these issues very well. Not t
by no_wizard 4y ago
This is what observables are all about, yet `rxjs` and the like never gained any wide spread traction, despite solving so many of these issues very well.
Not to mention there are many great upsides to using observables as well!
I remember at the time Promise was gaining acceptance toward a standard there was a rich debate about adding observables and leveraging this as the async primitive but developers complained loudly that they wanted something more primitive.
Then everyone complained about Promise being too verbose, so we got async await and async iterables.
And now that we have said primitive, people say well where are the promise helpers, promises alone aren't enough!
All of this could have been avoided with observables
- spion 4y agoObservables didn't properly integrate with promises at the right time - if they did they'd be accepted way more easily (e.g. `.first()` returning a Promise rather than an observable or `using` accepting promise return values and/or async functions and returning promises as a result). I gave the Dart API originally as an example, as it has careful considerations for when to return Future<T> instead of another Stream<T> (https://api.dart.dev/stable/2.18.7/dart-async/Stream-class.html https://api.dart.dev/stable/2.18.7/dart-async/Stream-class.h...) - examples include first(), last(), asyncMap etc.