ixfx
    Preparing search index...

    Type Alias CreateOptions<In>

    type CreateOptions<In> = {
        afterInsert: (element: HTMLElement) => void;
        beforeInsert: (element: HTMLElement) => void;
        beforeRemove: (element: HTMLElement) => void;
        byReference: boolean;
        key: (value: In) => string;
        parentEl: string | HTMLElement;
        tagName: string;
    }

    Type Parameters

    • In
    Index

    Properties

    afterInsert: (element: HTMLElement) => void

    Called after an element is inserted to the parent element

    beforeInsert: (element: HTMLElement) => void

    Called whenever an element is created but not yet added to parent element

    Type declaration

      • (element: HTMLElement): void
      • Parameters

        • element: HTMLElement

        Returns void

    beforeRemove: (element: HTMLElement) => void

    Called after an element has been removed

    Type declaration

      • (element: HTMLElement): void
      • Parameters

        • element: HTMLElement

        Returns void

    byReference: boolean

    Default: false. When true, associate created elements to values by reference rather than value. This can be useful with mutable values.

    Use this or the key option.

    key: (value: In) => string

    When set, provide a custom function to return a unique key for a value. This is used for matching values with elements when using immutable data.

    By default uses the JSON.stringify() representation.

    To match elements with values by reference, set byReference instead.

    Type declaration

      • (value: In): string
      • Parameters

        Returns string

    parentEl: string | HTMLElement

    Parent element to create elements in. Defaults to document.body.

    tagName: string

    What kind of HTML element to make, defaults to DIV