From 3ed24a62d19768258ca9925329e1bd84fe1172ea Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 9 Mar 2021 01:37:50 -0330 Subject: [PATCH] Add JSDOc comment for ControllerMessenger class --- src/ControllerMessenger.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ControllerMessenger.ts b/src/ControllerMessenger.ts index e0face32768..4010494d174 100644 --- a/src/ControllerMessenger.ts +++ b/src/ControllerMessenger.ts @@ -18,6 +18,13 @@ export type ExtractEventPayload = Event extends { type: T; payload: in type ActionConstraint = { type: string; handler: (...args: any) => unknown }; type EventConstraint = { type: string; payload: unknown[] }; +/** + * A messaging system for controllers. + * + * The controller messenger allows registering functions as 'actions' that can be called elsewhere, + * and it allows publishing and subscribing to events. Both actions and events are identified by + * unique strings. + */ export class ControllerMessenger { private actions = new Map();