(key: string, listener: ICommandCb)
| 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]; |
no outgoing calls
no test coverage detected