Type alias Config<T>

Config<T>: {
    deterministicFilter: ((model) => Iterable<T>);
    deterministicFilterCacheKeyFn: ((model) => string);
    filteredItemCache: Map<string, T[]>;
    isEmptyItem: ((value) => boolean);
    itemStore?: ItemStore<T>;
    namespace: string;
    preserveSelected?: boolean;
    sortSelectedItems?: ((a, b) => number);
    toItemId: ((item) => string | number);
    toItemInputValue: ((item) => string);
}

Remark

⚠️ All these functions should be deterministic!

Type Parameters

  • T

Type declaration

  • deterministicFilter: ((model) => Iterable<T>)
      • (model): Iterable<T>
      • Description

        The deterministicFilter function is used to filter the items in the suggestion dropdown. This must always be deterministic! That means it must always return the same order and same items for the same input.

        Parameters

        Returns Iterable<T>

  • deterministicFilterCacheKeyFn: ((model) => string)
      • (model): string
      • Parameters

        Returns string

  • filteredItemCache: Map<string, T[]>
  • isEmptyItem: ((value) => boolean)
      • (value): boolean
      • Parameters

        • value: T

        Returns boolean

  • Optional itemStore?: ItemStore<T>
  • namespace: string
  • Optional preserveSelected?: boolean

    When preserveSelected is set to true it will not unselect items that are not in the allItems list.

  • Optional sortSelectedItems?: ((a, b) => number)
      • (a, b): number
      • Parameters

        • a: T
        • b: T

        Returns number

  • toItemId: ((item) => string | number)
      • (item): string | number
      • Parameters

        • item: T

        Returns string | number

  • toItemInputValue: ((item) => string)
      • (item): string
      • Parameters

        • item: T

        Returns string

Generated using TypeDoc