()
| 90 | |
| 91 | function on(eventName, callback) { |
| 92 | const push = () => { |
| 93 | const currentListener = listeners.get(eventName); |
| 94 | return (Array.isArray(currentListener) |
| 95 | && currentListener.push(callback)) |
| 96 | || false; |
| 97 | }; |
| 98 | |
| 99 | const create = () => listeners.set(eventName, [].concat(callback)); |
| 100 |