Modal Selectors

getFirstModal

Retrieves the first modal off the stack from the modal data in the store.

Usage

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

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

Parameters

  • state (Object) required: The application state.

Returns

(Object|undefined): The modal information for the first item in the stack. If no modal information is found, it returns undefined.


getModalById

Retrieves the modal information for a modal ID from the modal data in the store.

Usage

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

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

Parameters

  • state (Object) required: The application state.
  • modalId (string) required: The modal ID to look for.

Returns

(Object|undefined): The modal information by ID. If no modal information is found, it returns undefined.