From b7d6f077bc25f7d29ba481025bfd6e9ea081e0ea Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Thu, 12 Feb 2026 21:44:36 -0700 Subject: [PATCH] feat: Enable asynchronous configuration loading and configuration signal Signed-off-by: Jacob Schlecht --- src/Client.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Client.ts b/src/Client.ts index 34d8091e..ef5a5b58 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -188,6 +188,9 @@ export class Client extends AsyncEventEmitter { readonly ready: Accessor; #setReady: Setter; + readonly configured: Accessor; + #setConfigured: Setter; + readonly connectionFailureCount: Accessor; #setConnectionFailureCount: Setter; #reconnectTimeout: number | undefined; @@ -239,6 +242,12 @@ export class Client extends AsyncEventEmitter { baseURL: this.options.baseURL, }); + const [configured, setConfigured] = createSignal(configuration !== undefined); + this.configured = configured; + this.#setConfigured = setConfigured; + + this.#fetchConfiguration(); + const [ready, setReady] = createSignal(false); this.ready = ready; this.#setReady = setReady; @@ -328,6 +337,7 @@ export class Client extends AsyncEventEmitter { async #fetchConfiguration(): Promise { if (!this.configuration) { this.configuration = await this.api.get("/"); + this.#setConfigured(true); } }