MCPcopy Create free account
hub / github.com/alibaba/lowcode-graph / register

Method register

packages/plugin-tools/src/common/command.ts:34–41  ·  view source on GitHub ↗
(key: string, listener: ICommandCb)

Source from the content-addressed store, hash-verified

32 }
33
34 register(key: string, listener: ICommandCb) {
35 this.commands[key] = listener;
36 if (this.ctx && this.graph) {
37 this.ctx?.event.on(`common:${key}`, (data: any) => {
38 listener(this.ctx, this.graph, data);
39 });
40 }
41 }
42
43 get(key: string) {
44 return this.commands[key];

Callers 5

index.tsFile · 0.80
index.tsFile · 0.80
DesignerClass · 0.80
G6DesignerClass · 0.80
initFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected