Finish this sentence: I would use native promises (instead of bluebird, RSVP) if only they _________.
-
-
the only promise-d api i know is fetch. and it's redundant. with CBs it was so simple - u use promises in applogic, cb in api calls
-
standard callback patterns are not intrinsically simpler than promises and more error prone (ever seen a cb run twice? I have)
-
but at this point, its too late to change direction. we already have CB apis and they are to stay. having 2 conventions=flustercluck
-
there is no one reliable convention. The callback convention is implemented wrong (cb called multiple times, wrong order) often
-
and XHR isn't even close to a standard callback pattern (nor IDB)
-
btw there are way more than just fetch using promises: animation, quota management, web midi, streams, font load, etc etc etc
-
quota window.webkitStorageInfo.requestQuota(type, sz, function cb() {}, function cb() {});
-
callback APIs exist but not standard. Can't promisify (or use async lib) with that. Can use Promise.all with the promise version.
- 4 more replies
New conversation -
-
-
so far both browsers and nodejs adopted callbacks. and you convert cbs to promises with 1 library call.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.