Interface ReconcileOptions<TItem, TChild>

Options for reconciliation.

interface ReconcileOptions<TItem, TChild> {
    container: HTMLElement;
    create: ((item: TItem, index: number) => TChild);
    items: TItem[];
    key?: ((item: TItem, index: number) => string);
    update: ((child: TChild, item: TItem, index: number) => void);
}

Type Parameters

  • TItem
  • TChild extends HTMLElement

Properties

container: HTMLElement

Target container

create: ((item: TItem, index: number) => TChild)

Function that creates an element from a given data item

items: TItem[]

List of data items

key?: ((item: TItem, index: number) => string)

Key function for item identification. If omitted, item.id or item.key or index is used.

update: ((child: TChild, item: TItem, index: number) => void)

Function that updates an existing element using the given data item