MCPcopy Index your code
hub / github.com/jabbany/CommentCoreLibrary / _dispatchEvent

Method _dispatchEvent

src/scripting/host/OOAPIWorker.ts:66–86  ·  view source on GitHub ↗
(channel:string, data:OOAPIMessage)

Source from the content-addressed store, hash-verified

64 }
65
66 private _dispatchEvent(channel:string, data:OOAPIMessage):void {
67 if (channel in this._channels) {
68 if (this._channels[channel].length === 0) {
69 if (typeof this._defaultChannelListener === 'function') {
70 this._defaultChannelListener(data);
71 } else {
72 throw new NoHandlerError(data);
73 }
74 return;
75 }
76 for (var i = 0; i < this._channels[channel].length; i++) {
77 this._channels[channel][i](data);
78 }
79 } else {
80 if (typeof this._defaultChannelListener === 'function') {
81 this._defaultChannelListener(data);
82 } else {
83 throw new NoHandlerError(data);
84 }
85 }
86 }
87
88 public send(message:OOAPIMessage):void {
89 this._worker.postMessage(JSON.stringify(message));

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected