Add "reset" functions to clients

This commit is contained in:
schroda
2025-11-07 01:25:36 +01:00
parent b062871163
commit 284c194ac3
3 changed files with 37 additions and 12 deletions

View File

@@ -32,6 +32,11 @@ export abstract class BaseClient<Client, ClientConfig, Fetcher> {
protected requestQueue: QueuedRequest[] = [];
public reset(): void {
BaseClient.activeTokenRefreshPromise = null;
this.clearQueue(new Error('Client reset'));
}
public static setTokenRefreshCompleteCallback(callback: (() => void) | null): void {
BaseClient.onTokenRefreshComplete = callback;
}