feat(tooltip-definition): dispatch open, close events

This commit is contained in:
Eric Liu 2022-02-01 07:08:57 -08:00
commit e19e413885

View file

@ -25,9 +25,15 @@
/** Obtain a reference to the button HTML element */
export let ref = null;
import { createEventDispatcher } from "svelte";
const dispatch = createEventDispatcher();
const hide = () => (open = false);
const show = () => (open = true);
$: dispatch(open ? "open" : "close");
</script>
<svelte:window