mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
8 lines
225 B
TypeScript
8 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),
|
|
};
|
|
}
|