feat: add onMany to BaseEventManager (#25492)

Use a map of events instead of array of tuples for better ergonomics.
This commit is contained in:
Min Idzelis
2026-01-26 10:34:26 -05:00
committed by GitHub
parent 836d22570f
commit 646bb372ab
4 changed files with 23 additions and 6 deletions
@@ -6,8 +6,10 @@ class UploadManager {
mediaTypes = $state<ServerMediaTypesResponseDto>({ image: [], sidecar: [], video: [] });
constructor() {
eventManager.on('AppInit', () => this.#loadExtensions());
eventManager.on('AuthLogout', () => this.reset());
eventManager.onMany({
AppInit: () => this.#loadExtensions(),
AuthLogout: () => this.reset(),
});
}
reset() {