-
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
Description
Reduce coupling between managers with a central event bus.
type EventMap = {
'config:changed': { scope: ConfigurationTarget; buttons: ButtonConfig[] };
'buttonSet:switched': { from: string | null; to: string | null };
'button:executed': { buttonId: string; command: string; timestamp: number };
'import:completed': { strategy: ImportStrategy; count: number };
'terminal:created': { terminalId: string; buttonId: string };
};
class EventBus {
on<K extends keyof EventMap>(event: K, handler: EventHandler<EventMap[K]>): Disposable;
emit<K extends keyof EventMap>(event: K, payload: EventMap[K]>): Promise<void>;
}
Current: ConfigManager directly calls StatusBarManager.refresh()
Improved: ConfigManager emits a 'config:changed' event → Interested parties subscribe to it.
- Decoupled managers.
- Easier testing.
- Adding new features doesn't require modifying existing code.
Metadata
Metadata
Assignees
Labels
Projects
Status
Done