@coveo/headless-react
    Preparing search index...

    Interface SearchActionCreators

    The search action creators.

    interface SearchActionCreators {
        executeSearch(): AsyncThunkAction<
            QuerySearchCommerceAPIThunkReturn,
            void,
            AsyncThunkCommerceOptions<StateNeededByExecuteSearch>,
        >;
        fetchMoreProducts(): AsyncThunkAction<
            null
            | QuerySearchCommerceAPIThunkReturn,
            void,
            AsyncThunkCommerceOptions<StateNeededByExecuteSearch>,
        >;
        prepareForSearchWithQuery(
            payload: PrepareForSearchWithQueryPayload,
        ): AsyncThunkAction<
            void,
            PrepareForSearchWithQueryPayload,
            AsyncThunkCommerceOptions<StateNeededByExecuteSearch>,
        >;
        promoteChildToParent(
            payload: PromoteChildToParentPayload,
        ): { payload: PromoteChildToParentPayload; type: string };
    }
    Index

    Methods

    • Executes a search query.

      Returns AsyncThunkAction<
          QuerySearchCommerceAPIThunkReturn,
          void,
          AsyncThunkCommerceOptions<StateNeededByExecuteSearch>,
      >

      A dispatchable action.

    • Fetches and additional page of products and appends it to the current list.

      Returns AsyncThunkAction<
          null
          | QuerySearchCommerceAPIThunkReturn,
          void,
          AsyncThunkCommerceOptions<StateNeededByExecuteSearch>,
      >

      A dispatchable action.

    • Updates the query, resets the pagination, and optionally clears all facets in preparation for a new search query.

      Parameters

      Returns AsyncThunkAction<
          void,
          PrepareForSearchWithQueryPayload,
          AsyncThunkCommerceOptions<StateNeededByExecuteSearch>,
      >

      A dispatchable action.

    • Promotes a child product to a parent product.

      Parameters

      • payload: PromoteChildToParentPayload

        The action creator payload.

      Returns { payload: PromoteChildToParentPayload; type: string }

      A dispatchable action.