Skip to content

History Selectors

Retrieves a single URL parameter from the query parameters object.

import { getQueryParam } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getQueryParam } from '@shopgate/pwa-common/selectors/history'

  • state (Object) required: The application state.
  • param (String) required: The dedicated URL parameter.

(Array|null): The URL parameter value. If no parameter value is found, it returns null.


Retrieves the sort order from the URL query parameters.

import { getSortOrder } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getSortOrder } from '@shopgate/pwa-common/selectors/history'

  • state (Object) required: The application state.

(string|null): The current sort order. If no sort order is found, it returns null.


Retrieves the search phrase from the URL query parameters.

import { getSearchPhrase } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getSearchPhrase } from '@shopgate/pwa-common/selectors/history'

  • state (Object) required: The application state.

(string|null): The current search phrase. If no search phrase is found, it returns null.


Retrieves the current history path name.

import { getHistoryPathname } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getHistoryPathname } from '@shopgate/pwa-common/selectors/history'

  • state (Object) required: The application state.

(string |null): The history path name. If no value is returned, the selector returns null.


Retrieves the length of the current history stack.

import { getHistoryLength } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getHistoryLength } from '@shopgate/pwa-common/selectors/history'

  • state (Object) required: The application state.

(number|null): The current length of the history stack.


Retrieves the query parameters from the history state as a pre-formatted string.

import { getQueryParamsAsString } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getQueryParamsAsString } from '@shopgate/pwa-common/selectors/history'

  • state (Object) required: The application state.

(string|null): The current query parameters.


Retrieves the history location from the history state.

import { getHistoryLocation } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getHistoryLocation } from '@shopgate/pwa-common/selectors/history'

  • state (Object) required: The application state.

(string|null): The current history location. If no value is found, it returns null.


Retrieves the current redirect location from the history state.

import { getRedirectLocation } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getRedirectLocation } from '@shopgate/pwa-common/selectors/history'

  • state (Object) required: The application state.

(string|null): The current redirect location. If no value is found, it returns null.