UNPKG

@shopgate/engage

Version:
8 lines 673 B
import{useRoute}from"./useRoute";import{getWidgetSettings}from"../config/getWidgetSettings";/** * Retrieves inherited settings for a widget given by its id and optional index on the current page. * See documentation of `getWidgetSettings` for further details. * * @param {string} widgetId The id of the widget to look for, which must exist in the config. * @param {number|undefined} [index=0] The optional index of the widget. * @returns {Object} */export function useWidgetSettings(widgetId){var index=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var _ref=useRoute()||{},pagePattern=_ref.pattern;return getWidgetSettings(pagePattern,widgetId,index);}