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

    Interface InstantResults

    The InstantResults controller allows the end user to manage instant results queries.

    Example: instant-results.fn.tsx

    interface InstantResults {
        state: InstantResultsState;
        clearExpired(): void;
        subscribe(listener: () => void): Unsubscribe;
        updateQuery(q: string): void;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Clears all expired instant results queries.

      Returns void

    • Adds a callback that's invoked on state change.

      Parameters

      • listener: () => void

        A callback that's invoked on state change.

      Returns Unsubscribe

      A function to remove the listener.

    • Updates the specified query and shows instant results for it.

      Parameters

      • q: string

        The query to get instant results for. For more precise instant results, query suggestions are recommended.

      Returns void

    Properties

    The state of the InstantResults controller.