- move backend/, clients/, scripts/ to DELETE/ (v0.1 era, replaced by on-device arch) - delete feature/v0.1-backend-and-macos branch - add TaskStore dependency to project.yml - fix ComposeViewModel deinit concurrency, make toMessageSummary public - regenerate Xcode project, verify macOS build succeeds Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
408 B
TypeScript
19 lines
408 B
TypeScript
export type EventHandler = (event: Record<string, unknown>) => void;
|
|
|
|
export class EventBus {
|
|
private subscribers = new Set<EventHandler>();
|
|
|
|
subscribe(handler: EventHandler): () => void {
|
|
this.subscribers.add(handler);
|
|
return () => {
|
|
this.subscribers.delete(handler);
|
|
};
|
|
}
|
|
|
|
publish(event: Record<string, unknown>): void {
|
|
for (const handler of this.subscribers) {
|
|
handler(event);
|
|
}
|
|
}
|
|
}
|