Files
immich/web/src/lib/utils/context.ts

9 lines
218 B
TypeScript
Raw Normal View History

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)
};
}