* Internal method used by delegate classes and subclasses to notify subscribers
(
handler: (subscriber: CopilotKitCoreSubscriber) => void | Promise<void>,
errorMessage: string,
)
| 494 | * Internal method used by delegate classes and subclasses to notify subscribers |
| 495 | */ |
| 496 | protected async notifySubscribers( |
| 497 | handler: (subscriber: CopilotKitCoreSubscriber) => void | Promise<void>, |
| 498 | errorMessage: string, |
| 499 | ): Promise<void> { |
| 500 | await Promise.all( |
| 501 | Array.from(this.subscribers).map(async (subscriber) => { |
| 502 | try { |
| 503 | await handler(subscriber); |
| 504 | } catch (error) { |
| 505 | console.error(errorMessage, error); |
| 506 | } |
| 507 | }), |
| 508 | ); |
| 509 | } |
| 510 | |
| 511 | /** |
| 512 | * Internal method used by delegate classes to emit errors |
no test coverage detected