mirror of
https://github.com/immich-app/immich.git
synced 2026-03-23 18:07:56 -04:00
14 lines
248 B
TypeScript
14 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()));
|
|
}
|
|
}
|