CustomEventEmitter
Handle for one custom Event selected through CustomEventAccess. The Event's emit function keeps the native handle alive; saved emitters and saved emit functions remain usable after garbage collection. The runtime resolves the Event definition again when emitting. An unavailable definition raises ReferenceError.
js
const threshold = this.event.ThresholdExceeded;
threshold.emit(this.property.temperature);
const emitThreshold = threshold.emit;
emitThreshold(this.property.temperature);Methods
emit(...args)
Emits the selected custom Event. Its name is selected when accessing this.event.EventName; it is not an argument to this function.
| Parameter | Type | Description |
|---|---|---|
args | * | Values for the Event's parameters, in definition order. |
Returns: undefined
js
this.event.ThresholdExceeded.emit(this.property.temperature);