Menu Selectors

getMenuById

Retrieves entries of a service menu by its ID from the menu data in the store.

Usage

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

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

Parameters

  • state (Object) required: The application state.
  • props (Object) required: The menu properties.
    • id (string) required: The ID of the menu.

Returns

(Object): The service menu data. If no menu data is found, it returns an empty object - {}.