@shopgate/engage
Version:
Shopgate's ENGAGE library.
5 lines • 575 B
JavaScript
import{createSelector}from'reselect';/**
* Returns all checkout campaign data
* @param {Object} state The application state.
* @returns {Array}
*/export var getCheckoutCampaign=function getCheckoutCampaign(state){return state.checkout.checkoutCampaign;};export var getCampaignAttribution=createSelector(getCheckoutCampaign,function(campaign){var campaignCode=campaign.campaignCode,channel=campaign.channel,distributionIndex=campaign.distributionIndex;if(!campaignCode){return null;}return{campaignCode:campaignCode,channel:channel,distributionIndex:distributionIndex};});