UNPKG

@threlte/extras

Version:

Utilities, abstractions and plugins for your Threlte apps

9 lines (8 loc) 254 B
import { getContext, setContext } from 'svelte'; const key = Symbol('threlte-instance-id'); export const createInstanceIdContext = (uuid) => { setContext(key, uuid); }; export const useInstanceId = () => { return getContext(key) ?? 'default'; };