• Similar to apply but uses selectAll (instead of the default selectFirst) to match elements.

    Type Parameters

    • T

    Parameters

    • components: T
    • Optional target: Element | DocumentFragment
    • Optional options: dom.IApplyOptions

    Returns Element | DocumentFragment

    Example

    import { applyAll } from 'deleight/dom/apply';
    import { map, range, forEach, zip } from 'deleight/generators';
    apply({
    applyAll: ([main]) => {
    const newContent = map(range(101, 120), i => `My index is now ${i}`);
    const lastChildren = map(main.children, c => c.lastElementChild);
    forEach(zip(lastChildren, newContent), ([el, c]) => el.textContent = c);
    // set(lastChildren, {textContent: newContent});
    }
    });