• Preact hook that import current actions to the component. Actions should be used to modify state, making new searches, etc.

    Returns {
        newSearch: (
            query: SearchQuery,
            options?: SearchOptions,
        ) => Promise<void>;
        replaceFilter: (
            field: string,
            value: undefined | string | InputSearchRangeFilter,
        ) => Promise<void>;
        toggleProductFilter: (
            field: string,
            value: string,
            active: boolean,
        ) => Promise<void>;
        updateSearch: (
            query: SearchQuery,
            options?: SearchOptions,
        ) => Promise<void>;
    }

    import { useActions } from '@nosto/search-js/preact'

    export default () => {
    const { newSearch } = useActions()

    return <button onClick={() => {
    newSearch({
    query: {
    query: "shoes"
    }
    })
    }}>
    Search for "shoes"
    </button>
    }
MMNEPVFCICPMFPCPTTAAATR