Comment

Comment by _benton

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.

parent _benton 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton