HM-50. Сделан универсальный компонент модалки (#19)

This commit is contained in:
Nikolay
2020-07-18 14:24:04 +03:00
committed by GitHub
parent 24f9b80ad6
commit d01ee79202
5 changed files with 158 additions and 30 deletions

View File

@ -40,7 +40,7 @@ class EmitService {
* _.next('click', arg1, arg2, ..., argN);
*/
next = (eventName, ...args) => {
const listeners = this._events[eventName];
const listeners = this._events[eventName] || [];
listeners.forEach((listener) => {
listener(...args);
});