3 ms·
JS has an event loop, it's single threaded but still lets you write asynchronous code. let send = (payload, callback) => fetch(...).then(callback) fetch() ret
by _benton 1y ago
JS has an event loop, it's single threaded but still lets you write asynchronous code.
let send = (payload, callback) => fetch(...).then(callback)
fetch() returns a promise synchronously, but it's not awaited.
- 63stack 1y agoI'm well aware, but the send() function in the article is not marked as async, and has no .then() calls.