UNPKG

@phystack/checkout-react

Version:

13 lines 511 B
import React, { createContext, useContext } from "react"; const CheckoutContext = createContext(null); export const CheckoutProvider = ({ children, service, }) => { return (React.createElement(CheckoutContext.Provider, { value: service }, children)); }; export const useCheckout = () => { const ctx = useContext(CheckoutContext); if (!ctx) { throw new Error("useCheckout must be used within a CheckoutProvider"); } return ctx; }; //# sourceMappingURL=checkout-service.provider.js.map