(evt: string, ...args: any[])
| 52 | } |
| 53 | |
| 54 | $broadcast(evt: string, ...args: any[]) { |
| 55 | if (this.events[evt]) { |
| 56 | this.events[evt].forEach((fn) => { |
| 57 | fn.apply(fn, args); |
| 58 | }); |
| 59 | } |
| 60 | return { |
| 61 | defaultPrevented: false, |
| 62 | preventDefault() { |
| 63 | this.defaultPrevented = true; |
| 64 | }, |
| 65 | }; |
| 66 | } |
| 67 | |
| 68 | $on(evt: string, fn: any) { |
| 69 | this.events[evt] ||= []; |
no test coverage detected