All Results
all result aggregation
function* renderDashboard() {
const pageData = yield* all([
function* loadUser() {
yield* sleep(1000);
return "user";
},
function* loadSettings() {
yield* sleep(2000);
return "settings";
},
] as const);
const [user, settings] = yield* wait(pageData);
return { user, settings };
} renderDashboard starts loadUser and loadSettings together through all.
pageData is a single future that resolves after both work results are collected.