(type, handle)
| 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); |
no test coverage detected