3 ms·
Yes and JS had a smooth on-ramp to async/await thanks to Promises. Promises/thenables gave people the time to get used to the idea of deferred evaluation via a
by jongjong 1y ago
Yes and JS had a smooth on-ramp to async/await thanks to Promises.
Promises/thenables gave people the time to get used to the idea of deferred evaluation via a familiar callback approach... Then when async/await came along, people didn't see it as a radically new feature but more as syntactic sugar to do what they were already doing in a more succinct way without callbacks.
People in the Node.js community were very aware of async concepts since the beginning and put a lot of effort in not blocking the event loop. So Promises and then async/await were seen as solutions to existing pain points which everyone was already familiar with. A lot of people refactored their existing code to async/await.
- laurencerowe 1y agoJavaScript’s Promises were of course heavily influenced by Twisted’s Deferreds in Python, from the days before async/await.