Command.end Event

The end event fires when activation of a command ends. This is the proper way to run code in response to discrete input event.

Event type

The event uses the CommandEvent object, with the phase set to "end".

Example

> ident = simulator.findCommand("sim/transponder/transponder_ident")
Command{ name: "sim/transponder/transponder_ident" }
> ident.addEventListener("begin", (event) => { console.log(`Received command event with phase {event.phase}`)})
undefined
> ident.begin()
undefined
> ident.end()
Received command event with phase end
undefined

References