Skip to main content

SearchState

Where a search stands. Exactly one of these is true at a time.

This is a type alias exported by @mapcairn/map, checked against version 0.2.0.

Signature​

import type { SearchState } from "@mapcairn/map";

type SearchState = {
readonly status: "idle";
} | {
readonly status: "loading";
} | {
readonly status: "results";
readonly results: readonly SearchResult[];
} | {
readonly status: "empty";
} | {
readonly status: "error";
readonly kind: SearchErrorKind;
};

See also​

Source: packages/map/src/tools/SearchPill/useSearch.ts:30