Continued refactoring of the maps library.
This commit is contained in:
@@ -331,8 +331,14 @@ export class EventHandler {
|
||||
}
|
||||
|
||||
call(context, ...args) {
|
||||
this.listeners.forEach(listener => listener.call(context, ...args))
|
||||
this.onces.forEach(listener => listener.call(context, ...args))
|
||||
if (context == null) {
|
||||
this.listeners.forEach(listener => listener(...args))
|
||||
this.onces.forEach(listener => listener(...args))
|
||||
} else {
|
||||
this.listeners.forEach(listener => listener.call(context, ...args))
|
||||
this.onces.forEach(listener => listener.call(context, ...args))
|
||||
}
|
||||
|
||||
this.onces = []
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user