(event, handler)
| 18 | } |
| 19 | |
| 20 | off(event, handler) { |
| 21 | if (isUndefined(this.bindings) || |
| 22 | isUndefined(this.bindings[event])) { |
| 23 | return this; |
| 24 | } |
| 25 | |
| 26 | if (isUndefined(handler)) { |
| 27 | delete this.bindings[event]; |
| 28 | } else { |
| 29 | this.bindings[event].forEach((binding, index) => { |
| 30 | if (binding.handler === handler) { |
| 31 | this.bindings[event].splice(index, 1); |
| 32 | } |
| 33 | }); |
| 34 | } |
| 35 | |
| 36 | return this; |
| 37 | } |
| 38 | |
| 39 | trigger(event, ...args) { |
| 40 | if (!isUndefined(this.bindings) && this.bindings[event]) { |
no test coverage detected