This commit is contained in:
Morten Olsen
2025-10-23 20:31:15 +02:00
parent b851dc3006
commit 78995406ca
46 changed files with 707 additions and 119 deletions

View File

@@ -1,4 +1,5 @@
const API_GROUP = 'playground.homelab.olsen.cloud';
const API_VERSION = `${API_GROUP}/v1`;
const FINALIZER = `finalizer.${API_GROUP}`;
export { API_VERSION, API_GROUP };
export { API_VERSION, API_GROUP, FINALIZER };

View File

@@ -23,7 +23,7 @@ class EventEmitter<T extends Record<string, (...args: ExplicitAny[]) => void | P
abortController.signal.addEventListener('abort', () => {
this.#listeners.set(event, listeners?.difference(new Set([callbackClone])));
});
return abortController.abort;
return () => abortController.abort();
};
once = <K extends keyof T>(event: K, callback: EventListener<Parameters<T[K]>>, options: OnOptions = {}) => {
@@ -62,4 +62,3 @@ class EventEmitter<T extends Record<string, (...args: ExplicitAny[]) => void | P
}
export { EventEmitter };

View File

@@ -28,6 +28,6 @@ function isDeepSubset<T>(actual: ExplicitAny, expected: T): expected is T {
}
return true;
};
}
export { isDeepSubset };

View File

@@ -38,4 +38,3 @@ class Queue {
}
export { Queue };