@revenuecat/purchases-ui-js
Version:
Web components for Paywalls. Powered by RevenueCat
14 lines (13 loc) • 378 B
JavaScript
import { getContext, setContext } from "svelte";
import {} from "svelte/store";
const key = Symbol("paywall");
export function setPaywallContext(context) {
setContext(key, context);
}
export function getPaywallContext() {
const context = getContext(key);
if (context === undefined) {
throw new Error("Paywall context not found");
}
return context;
}