UNPKG

reblendjs

Version:

This is build using react way of handling dom but with web components

13 lines (12 loc) 492 B
/* 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: (e: Event) => any): (e: Event) => void { return async (e) => eventCallback && eventCallback(e) } }