UNPKG

@ssgoi/svelte

Version:

Svelte bindings for SSGOI - Native app-like page transitions for Svelte and SvelteKit applications

13 lines (12 loc) 394 B
import { getContext, setContext } from "svelte"; var SSGOI_CONTEXT_KEY = Symbol("ssgoi"); export function setSsgoiContext(context) { setContext(SSGOI_CONTEXT_KEY, context); } export function getSsgoiContext() { var context = getContext(SSGOI_CONTEXT_KEY); if (!context) { throw new Error("getSsgoiContext must be called within Ssgoi component"); } return context; }