mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
13 lines
248 B
TypeScript
13 lines
248 B
TypeScript
export type Task = () => Promise<unknown> | unknown;
|
|
|
|
export class Tasks {
|
|
private tasks: Task[] = [];
|
|
|
|
push(...tasks: Task[]) {
|
|
this.tasks.push(...tasks);
|
|
}
|
|
|
|
async all() {
|
|
await Promise.all(this.tasks.map((item) => item()));
|
|
}
|
|
}
|