Refactor to useOpenClosed

Fixes #6
This commit is contained in:
Ryan Gossiaux
2021-12-18 21:36:09 -08:00
parent 4a6edb4e1c
commit 9e45d92929
11 changed files with 23 additions and 27 deletions

View File

@@ -1,15 +1,13 @@
<script lang="ts">
import { ActionArray, useActions } from "$lib/hooks/use-actions";
import { State } from "$lib/internal/open-closed";
import { getContext } from "svelte";
import type { Writable } from "svelte/store";
import { State, useOpenClosed } from "$lib/internal/open-closed";
import { PopoverStates, usePopoverContext } from "./Popover.svelte";
export let use: ActionArray = [];
let api = usePopoverContext("PopoverOverlay");
let openClosedState: Writable<State> | undefined = getContext("OpenClosed");
let openClosedState = useOpenClosed();
$: visible =
openClosedState !== undefined