5 ms·
Promises instead of archaic callbacks. That's a feature I'm excited about!
by mcochrane 9y ago
Promises instead of archaic callbacks. That's a feature I'm excited about!
- jordache 9y agopromise is callback. When used in the context of the simple data loading scenario typical of D3, there is no difference.
- bfred_it 9y agoNot exactly and not necessarily. You can await a Promise and not have any functions at all: await thing() console.log(‘Thing done’) Also you could attach multiple callbacks to the same Promise at any point, even long after the promise fulfilled.
- always_good 9y agoPromises compose, bubble errors, lift sync errors, can be awaited, have combinators like Promise.all(), they're where the ecosystem headed, and more. Thinking that promises are callbacks because .then() takes a function suggests misunderstanding.
- esturk 9y agoThey aren't even executed in the same queue.