MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / on

Method on

src/common/events.js:13–22  ·  view source on GitHub ↗
(type, handle)

Source from the content-addressed store, hash-verified

11 }
12
13 on(type, handle) {
14 this.checkType(type);
15 const { events } = this;
16 let handlers = events[type];
17 if (!handlers) {
18 handlers = [];
19 events[type] = handlers;
20 }
21 return () => this.off(type, handle);
22 }
23
24 off(type, handle) {
25 this.checkType(type);

Callers 2

runCommandFunction · 0.80
base.jsFile · 0.80

Calls 2

checkTypeMethod · 0.95
offMethod · 0.95

Tested by

no test coverage detected