mirror of
https://github.com/immich-app/immich.git
synced 2025-06-10 17:14:40 -04:00
9 lines
225 B
TypeScript
9 lines
225 B
TypeScript
import { getContext, setContext } from 'svelte';
|
|
|
|
export function createContext<T>(key: string | symbol = Symbol()) {
|
|
return {
|
|
get: () => getContext<T>(key),
|
|
set: (context: T) => setContext<T>(key, context),
|
|
};
|
|
}
|