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

Function isBridgeEvent

packages/react/src/utils/Bridge/BridgeEvent.ts:48–62  ·  view source on GitHub ↗
(data: unknown)

Source from the content-addressed store, hash-verified

46export type BridgeEventType = BridgeEvent['type'];
47
48export const isBridgeEvent = (data: unknown): data is BridgeEvent => {
49 if (!data || typeof data !== 'object') {
50 return false;
51 }
52
53 return [
54 HostEventType.Initialize,
55 HostEventType.TitleUpdated,
56 HostEventType.ContentRequested,
57 GuestEventType.Ready,
58 GuestEventType.ContentProvided,
59 GuestEventType.SettingsClicked,
60 GuestEventType.SaveClicked,
61 ].includes((data as BridgeEvent).type);
62};

Callers 1

handleMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected