TypeScript로 작성한 Pub-Sub 패턴 class EventBus { private subscribers: { [key: string]: Function[] } = {}; subscribe(eventType: string, callback: Function) { if (!this.subscribers[eventType]) { this.subscribers[eventType] = []; } this.subscribers[eventType].push(callback); } publish(eventType: string, data?: any) { if (this.subscribers[eventType]) { this.subscribers[eventType].forEach(callback => { ca..