Interface State

Preact state includes all changing variables of the app. After each change page is automatically rerendered. State includes user input, output and other useful things.

interface State {
    customParams: Record<string, unknown>;
    historyItems?: string[];
    initialized: boolean;
    loading: boolean;
    pageType: undefined | PageType;
    query: SearchQuery;
    response: SearchResult;
}

Properties

customParams: Record<string, unknown>

Custom params from URL

historyItems?: string[]

History items

initialized: boolean

Indicates that preact app is initialized.

loading: boolean

Indicates that the search is loading, loader should be shown when true.

pageType: undefined | PageType

Displays which page type it is - category | search

Current search query that includes all user input like search text, filters, sort, page, etc.

response: SearchResult

Current search response that includes found products, keywords and other results.