Simplified undefined check
This commit is contained in:
parent
dfe51421ab
commit
f1c1a02877
@ -29,9 +29,7 @@ class EventHandler {
|
||||
if (this.suppresEvents) return []
|
||||
this.eventCount++
|
||||
const returnValue = this.events[event].listeners.map((listener) => {
|
||||
const returnValue = listener(data)
|
||||
if (returnValue == undefined) return null
|
||||
return returnValue
|
||||
return listener(data) ?? null
|
||||
})
|
||||
this.events[event].callCount++
|
||||
if (this.debugEvents) {
|
||||
|
Loading…
Reference in New Issue
Block a user