3 ms·
> without async/await it wasn't really necessary to standardize Hard disagree. `x instanceof Promise` simply doesn't work. If my library has a then method tha
by bastawhiz 3y ago
> without async/await it wasn't really necessary to standardize
Hard disagree.
`x instanceof Promise` simply doesn't work. If my library has a then method that accepts a catch callback and yours doesn't, they're silently non-interoperable, and there's no way to detect it. When does `finally` run? What expectations can you have around how async the callbacks are? Without a standard, every single library that uses promises needs to bring its own polyfill because you can't trust what's there. And you can't actually consume any other library's promises, because you can't trust that they behave in the way you expect them to.
And I'm not just speculating, this was reality for many years and a hell that many of us had to endure.