mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
21 lines
491 B
TypeScript
21 lines
491 B
TypeScript
import { createContext as createSvelteContext } from "svelte";
|
|
import type { SelectedCategory } from "#lib/features/filesystem/components/index.ts";
|
|
|
|
export interface SelectedFile {
|
|
id: number;
|
|
name: string;
|
|
}
|
|
|
|
interface Context {
|
|
selectedCategory?: SelectedCategory;
|
|
}
|
|
|
|
const [getContext, setContext] = createSvelteContext<Context>();
|
|
|
|
export const createContext = () => {
|
|
const context: Context = $state({});
|
|
return setContext(context);
|
|
};
|
|
|
|
export const useContext = getContext;
|