@@ -2,12 +2,19 @@
|
||||
export interface StateDefinition {
|
||||
switchStore: Writable<HTMLButtonElement | null>;
|
||||
}
|
||||
|
||||
const SWITCH_CONTEXT_NAME = "SwitchContext";
|
||||
export function useSwitchContext():
|
||||
| Writable<StateDefinition | undefined>
|
||||
| undefined {
|
||||
return getContext(SWITCH_CONTEXT_NAME);
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import DescriptionProvider from "./DescriptionProvider.svelte";
|
||||
import LabelProvider from "./LabelProvider.svelte";
|
||||
import { setContext } from "svelte";
|
||||
import { getContext, setContext } from "svelte";
|
||||
import { Writable, writable } from "svelte/store";
|
||||
|
||||
let switchStore: Writable<HTMLButtonElement | null> = writable(null);
|
||||
|
||||
Reference in New Issue
Block a user