WICG / observable

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

Is it worth showing possible APIs that could be built with observable? #25

Open benlesh opened 1 year ago

benlesh commented 1 year ago

There are some APIs that we don't have that Observable might be really good for... for example, dealing with "upload then download" sort of XHR and fetch semantics is frankly ugly most of the time. Where a single stream of something shaped like { status, progress, data } or the like makes for a pretty interesting/ergonomic way to build UIs on top of such things. WebSockets are another one... they start connecting, then open, or close (clean or unclean), or error, they get messages, etc. All of that could be sent through one stream of events, and it makes it so the developer doesn't have to know the dance between different events.

domfarolino commented 11 months ago

My 2c is yes, the more examples the better! We can turn some of these into non-normative code examples in the specification one it exists too, but getting them in the explainer for now would be wonderful.