@cfxlabsinc/b2b-services
    Preparing search index...
    type UseInfiniteOptionsInput<T> = {
        debounceMs?: number;
        fetchPage: EntitySelectorFetchPage<T>;
        initialFacets?: ComboboxFacetValues;
        initialPage?: EntitySelectorPage<T> | null;
        noun: string;
        queryKey: ReadonlyArray<unknown>;
        sortOptions?: readonly EntitySelectorSortOption[];
    }

    Type Parameters

    • T
    Index
    debounceMs?: number

    Gap between the last keystroke and the query re-keying. Defaults to DEBOUNCE_MS, which exists to spare the server; pass 0 for a client-held source (staticOptionsPage) where there is no round-trip to spare and a debounce only makes a bounded list feel laggier than the plain Command filtering it replaces.

    Fetches one page of options; { ok: false } becomes the error state.

    initialFacets?: ComboboxFacetValues

    Initial facet selections (facet key → values). Default {}.

    initialPage?: EntitySelectorPage<T> | null

    Server-rendered first page, seeding react-query so the list paints populated instead of pending. react-query scopes initialData to one exact key, so this applies only to the default view: empty query, first sort option, no facets. Typing / re-sorting / faceting re-keys and fetches live. The server that produced it must therefore have called fetchPage with { query: "", sort: sortOptions[0].value ?? "", facets: {} }.

    noun: string

    Plural noun for the entity, used in error copy (e.g. "customers").

    queryKey: ReadonlyArray<unknown>

    Base react-query key identifying this option source. The debounced query and active sort are appended internally, so a change to either re-fetches. Two comboboxes that share a noun but return differently-shaped rows must pass distinct keys so their caches don't collide.

    sortOptions?: readonly EntitySelectorSortOption[]

    Sort choices; the first is the default. Omit for an unsorted source.