@revenuecat/purchases-ui-js
Version:
Web components for Paywalls. Powered by RevenueCat
13 lines (12 loc) • 339 B
JavaScript
import { getContext, setContext } from "svelte";
const key = Symbol("selected");
export function setTabsContext(context) {
setContext(key, context);
}
export function getTabsContext() {
const context = getContext(key);
if (context === undefined) {
throw new Error("Tabs context not found");
}
return context;
}