MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / publish

Method publish

packages/message/message_queue.ts:75–83  ·  view source on GitHub ↗
(topic: string, message: NonNullable<T>)

Source from the content-addressed store, hash-verified

73 }
74
75 publish<T>(topic: string, message: NonNullable<T>) {
76 chrome.runtime.sendMessage({
77 msgQueue: topic,
78 data: { action: "message", message },
79 });
80 this.EE.emit(topic, message);
81 //@ts-ignore
82 LoggerCore.getInstance().logger({ service: "messageQueue" }).trace("publish", { topic, message });
83 }
84
85 // 只发布给当前环境
86 emit<T>(topic: string, message: NonNullable<T>) {

Callers

nothing calls this directly

Calls 5

traceMethod · 0.80
getInstanceMethod · 0.80
sendMessageMethod · 0.65
emitMethod · 0.65
loggerMethod · 0.45

Tested by

no test coverage detected