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