|
|
|
|
|
by distracteddev90
4131 days ago
|
|
Both callbacks and promises are fairly simple interfaces for calling a function after some other function has completed. Both interfaces can be abused to give you an ever growing indent and give the appearance of "callback hell" Both interfaces can be use elegantly to help you reason about your code, make it easy to follow, and handle errors centrally. Only one is supported natively by node.js and is the standard async interface for 90% of node.js's libraries: Callbacks. Also, regarding "callback hell", a straw-man argument against callbacks, I highly suggest reading http://callbackhell.com/ |
|