UNPKG

@threlte/core

Version:

A 3D framework for the web, built on top of Svelte and Three.js

11 lines (10 loc) 283 B
import { getContext, setContext } from 'svelte'; import { pluginContextKey } from './types.js'; export function injectPlugin(name, plugin) { if (!plugin) return; setContext(pluginContextKey, { ...getContext(pluginContextKey), [name]: plugin }); }