Function arrowAttributes

  • Format HTML attributes as tagged tmplate

    Example

    Format properties for to ArrowJS

    import { html } from '@arrow-js/core';
    import { arrowTags } from 'arrow-tags';
    const props = {style: 'color: red;', id: 'red-span'};
    const [ pads, ...vals ] = arrowAttributes('span', props);
    // <span style="color: red;" id="red-span">hello</span>
    const el = document.getElementById('root');
    html([...pads, '</span>'], ...[...vals, 'hello'])(el);

    Parameters

    • tag: string

      string for valid HTML tag

    • att: Data

      object with attributes

    Returns Children

    tagged tmplate inputs

Generated using TypeDoc