MCPcopy Create free account
hub / github.com/composify-js/composify / handle

Method handle

packages/react/src/utils/Bridge/Bridge.ts:48–71  ·  view source on GitHub ↗
(message: MessageEvent)

Source from the content-addressed store, hash-verified

46 }
47
48 private handle(message: MessageEvent) {
49 if (message.source !== this.target) {
50 return;
51 }
52
53 if (this.origin !== '*' && message.origin !== this.origin) {
54 return;
55 }
56
57 if (!isBridgeEvent(message.data)) {
58 return;
59 }
60
61 const event = message.data;
62 const listeners = this.listeners.get(event.type);
63
64 listeners?.forEach((listener) => {
65 try {
66 listener(event);
67 } catch (error: unknown) {
68 console.error(error);
69 }
70 });
71 }
72}

Callers

nothing calls this directly

Calls 1

isBridgeEventFunction · 0.90

Tested by

no test coverage detected