WICG / observable

Observable API proposal
https://wicg.github.io/observable/
Other
563 stars 13 forks source link

Lean harder on the promises analogy #10

Closed domenic closed 1 year ago

domenic commented 1 year ago

The most compelling story I find, for web platform folks, is "observables are to events as promises are to callbacks". Everyone loves how by making an async result into a first-class object, promises unlocked a lot. In short:

And, even better than the callbacks -> promises transition, because of how EventTarget is already everywhere and we've found the perfect way to slot into EventTarget, this won't be a case of having to migrate the whole web platform. We'll just get this nice upgrade to first-class objects, for free, whenever the web developer wants to switch their code!

I think this selling point should be relatively high in the readme.