UNPKG

@shopgate/engage

Version:
11 lines 974 B
import{createSelector}from'reselect';/** * Selects the push opt-in modal state. * @param {Object} state The current state of the push opt-in modal. * @returns {Object} whether push opt-in modal is shown. */export var getPushOptInModalState=function getPushOptInModalState(state){var _state$pushOptIn;return(state===null||state===void 0?void 0:(_state$pushOptIn=state.pushOptIn)===null||_state$pushOptIn===void 0?void 0:_state$pushOptIn.optInModal)||{};};/** * Determines visibility of the Push-Opt-In Modal * @returns {boolean} whether push opt-in modal is shown. */export var getIsPushOptInModalVisible=createSelector(getPushOptInModalState,function(modalState){return modalState.isPushOptInModalVisible||false;});/** * Determines the trigger type of the Push-Opt-In Modal * @returns {string} whether push opt-in modal is shown. */export var getPushOptInModalTriggerType=createSelector(getPushOptInModalState,function(modalState){return modalState.triggerType;});