11 lines
357 B
TypeScript
11 lines
357 B
TypeScript
// Forbidden: a dispatch inside a loop over rows.
|
|
type Http = { execute(operation: string, input: unknown): Promise<unknown> };
|
|
|
|
export async function loadEach(http: Http, rows: readonly { id: string }[]) {
|
|
const results: unknown[] = [];
|
|
for (const row of rows) {
|
|
results.push(await http.execute("GET_ROW", { id: row.id }));
|
|
}
|
|
return results;
|
|
}
|