Open this example in the interactive library
Source code
const load = async (id: number): Promise<{ id: number; ready: boolean }> => ({
id,
ready: true,
});
console.log(((row: Awaited<ReturnType<typeof load>>) => row.id)(await load(4)));
Sample output
4
