A utility function that takes an element, applies transformations, and returns the modified element. Typically used to enhance or manipulate the DOM element in a declarative way.
The type of element the utility operates on.
const addClass: Utility<HTMLDivElement> = (el) => { el.classList.add("highlight"); return el;}; Copy
const addClass: Utility<HTMLDivElement> = (el) => { el.classList.add("highlight"); return el;};
A utility function that takes an element, applies transformations, and returns the modified element. Typically used to enhance or manipulate the DOM element in a declarative way.