Hacker News new | ask | show | jobs
by _benton 343 days 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.

1 comments

I'm well aware, but the send() function in the article is not marked as async, and has no .then() calls.