2 ms·
The TL;DR: * Callbacks passed to cb-based libraries may be called twice - promises are only resolved once, either fulfilled or rejected. * Callback-based libr
by ufo 13y ago
The TL;DR:
* Callbacks passed to cb-based libraries may be called twice - promises are only resolved once, either fulfilled or rejected.
* Callback-based libraries may blow up if the callback throws - promise libraries shield the callback stack from "blowing up" (but do require slightly less careless management of resources at the call-stack site)
* Callbacks passed to cb-based libraries may be called before the current even tick completes, potentially creating the zalgo problem - callbacks attached to promises are always called after the currently executed function finishes.