@shopgate/engage
Version:
Shopgate's ENGAGE library.
4 lines • 584 B
JavaScript
import{createSelector}from'reselect';import pathMatch from'path-match';import{getCurrentPathname}from'@shopgate/pwa-common/selectors/router';import{checkoutRoutes}from'@shopgate/engage/checkout/constants';var matcher=pathMatch({sensitive:false,strict:false,end:true});/**
* Creates a selector that determines if a route belongs to the checkout process
* @returns {Function}
*/export var makeIsCheckoutRoute=function makeIsCheckoutRoute(){return createSelector(getCurrentPathname,function(pathname){return checkoutRoutes.some(function(route){return matcher(route)(pathname);});});};