Emits an event on this layer's element.
The value of up.layer.current will be set to 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 event type, e.g. my:event.
A list of properties to become part of the event object that will be passed to listeners.
The emitted event object.
Tip Your coding agent can search these docs locally with the Unpoly agent skill