listen
This function registers the given event listener to be called whenever the given event occurs. The returned cancellation function can be called to unregister the event listener so that it is not triggered anymore.
The list of valid event names is:
resolution
- For resolution changes with
waywall.set_resolution()
- For resolution changes with
state
- For updates to the instance's state-output file
Arguments
event
: stringlistener
: function
Return values
cancel
: function