export class Lazy { #value?: T; constructor(private readonly resolver: () => Promise) {} async value(): Promise { if (!this.#value) { this.#value = await this.resolver(); } return this.#value; } }