reblendjs
Version:
This is build using react way of handling dom but with web components
12 lines • 451 B
JavaScript
/* eslint-disable @typescript-eslint/no-explicit-any */
export class EventUtil {
/**
* Wraps an event callback function, ensuring that the event callback is always called.
*
* @param {(e: Event) => any} [eventCallback=() => {}] - The event callback to be wrapped.
* @returns {(e: Event) => void} A function that invokes the event callback.
*/
static fn(eventCallback) {
return async e => eventCallback && eventCallback(e);
}
}