2 ms·
And then as you use promise based code more and more (including with async/await), you eventually come to realize that while it looked good at first, its deeply
by shados 10y ago
And then as you use promise based code more and more (including with async/await), you eventually come to realize that while it looked good at first, its deeply, deeply flawed, and is at best a stepping stone to Observables :)
- egeozcan 10y agoAn observable is semantically very different to a promise, even if it can be thought as a promise with subsequent success calls. Here is the proposal: https://github.com/tc39/proposal-observable https://github.com/tc39/proposal-observable
- shados 10y agoYour point being? The semantic is different, but everything a promise can do, an observable can do (with roughly the same amount of code), but the other way around isn't true. Observables are just better in basically every ways. Real world implementations also have proper error handling and decent APIs to handle aborting -today-, while the TC39 is still jumping back and forth trying to figure out how to handle it in promises so that Fetch can stop being useless.