Function applyTo

  • Applies the given functions to the specified elements (or CSS rules).

    asComponent specifies whether the functions should be applied to each element. If falsy/not specified, all the elements are passed to the functions at once.

    Parameters

    • elements: Element | CSSRule | (Element | CSSRule)[]
    • components: IComponents
    • Optional atomic: number | boolean
    • Optional selectFirst: number | boolean

    Returns void

    Example

    import { applyTo } from 'deleight/appliance';
    applyTo(Array.from(document.body.children), (...bodyChildren) => console.log(bodyChildren.length));