code/component-on-event.js
// custom component for registering an event handler
custom component for registering an event handler
custom component for registering an event handler
function onEvent(event, cb) {
	return {
		id: "on",
		add() {
			this.on(event, (...args) => cb(this, ...args));
		},
	};
}
function onEvent ( event , cb ) { return { id : "on" , add ( ) { this . on ( event , ( ... args ) => cb ( this , ... args ) ) ; } , } ; }
custom component for registering an event handler
custom component for registering an event handler