@shopgate/engage
Version:
Shopgate's ENGAGE library.
5 lines • 549 B
JavaScript
import{useContext}from'react';import RegistrationContext from"../providers/RegistrationProvider.context";import GuestRegistrationContext from"../providers/GuestRegistrationProvider.context";/**
* Returns the value of the checkout provider state.
* @param {bool} isGuest Whether the registration is a guest registration
* @returns {Object}
*/export var useRegistration=function useRegistration(){var isGuest=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;return useContext(isGuest?GuestRegistrationContext:RegistrationContext);};