Emits an event on this layer's element.
The value of up.layer.current will be set to the this layer while event listeners are running.
let rootLayer = up.layer.root
let overlay = await up.layer.open()
rootLayer.on('foo', (event) => console.log('Listener called'))
rootLayer.emit('foo') // logs "Listener called"
overlay.emit('foo') // listener is not called
The element on which the event is triggered.
If omitted, the event will be emitted on the this layer's element.
The event type, e.g. my:event
.
A list of properties to become part of the event object that will be passed to listeners.
A message to print to the log when the event is emitted.
Pass false
to not log this event emission.