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

    Interface HistoryManager

    The HistoryManager controller is in charge of allowing navigating back and forward in the search interface history.

    Example: history-manager.fn.tsx

    interface HistoryManager {
        state: HistoryManagerState;
        back(): Promise<void>;
        backOnNoResults(): Promise<void>;
        forward(): Promise<void>;
        subscribe(listener: () => void): Unsubscribe;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Move backward in the interface history.

      Returns Promise<void>

      A promise that resolves when the previous state has been restored.

    • Move backward in the interface history when there are no results.

      Returns Promise<void>

      A promise that resolves when the previous state has been restored.

    • Move forward in the interface history.

      Returns Promise<void>

      A promise that resolves when the next state has been restored.

    • 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.

    Properties

    The state relevant to the HistoryManager controller.