Comment

Comment by dave4420

I wish we had syntax like

    concurrently {
        const user = await getUser(userId);
        const session = await getSession(sessionId);
    }
meaning that

- the getUser and getSession calls occur concurrently (it desugars to Promise.all)

- user and session are available for use after the block

- user and session appear directly next to the calls that give them their values, unlike with Promise.all

parent dave4420 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton