fix(db): 🏷️ update types to allow async filter for listing ressources

This commit is contained in:
Julien Oculi 2024-06-18 10:14:22 +02:00
parent 3b378b0968
commit 2028c0134a

View file

@ -55,8 +55,9 @@ export class Db {
set: (ressources: T[]) => this.#set<T>(type, ressources),
delete: (ressources: Pick<T, 'uuid'>[]) =>
this.#delete<T>(type, ressources),
list: (filter: (ressource: T) => boolean = () => true) =>
this.#list<T>(type, Builder, filter),
list: (
filter: (ressource: T) => boolean | Promise<boolean> = () => true,
) => this.#list<T>(type, Builder, filter),
}
}