mirror of
https://github.com/immich-app/immich.git
synced 2025-01-10 13:56:47 +01:00
f55b3add80
Co-authored-by: Thomas Way <thomas@6f.io>
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),
|
|
};
|
|
}
|