Run prettier over everything and fix some imports

This commit is contained in:
Ryan Gossiaux
2021-12-13 18:22:16 -08:00
parent 3bf974a654
commit 82b138f0ae
63 changed files with 3317 additions and 3319 deletions

View File

@@ -1,42 +1,39 @@
<script lang="ts" context="module">
export enum StackMessage {
Add,
Remove,
}
export enum StackMessage {
Add,
Remove,
}
</script>
<script lang="ts">
import { getContext, setContext } from "svelte";
import { writable, Writable } from "svelte/store";
type OnUpdate = (
message: StackMessage,
element: HTMLElement | null
) => void;
import { getContext, setContext } from "svelte";
import { writable, Writable } from "svelte/store";
type OnUpdate = (message: StackMessage, element: HTMLElement | null) => void;
export let onUpdate: OnUpdate | undefined;
export let element: HTMLElement | null;
export let onUpdate: OnUpdate | undefined;
export let element: HTMLElement | null;
let parentUpdateStore: Writable<OnUpdate> | undefined =
getContext("StackContext");
let notifyStore: Writable<OnUpdate> = writable(() => {});
setContext("StackContext", notifyStore);
let parentUpdateStore: Writable<OnUpdate> | undefined =
getContext("StackContext");
let notifyStore: Writable<OnUpdate> = writable(() => {});
setContext("StackContext", notifyStore);
$: notifyStore.set((...args: Parameters<OnUpdate>) => {
// Notify our layer
onUpdate?.(...args);
$: notifyStore.set((...args: Parameters<OnUpdate>) => {
// Notify our layer
onUpdate?.(...args);
// Notify the parent
$parentUpdateStore?.(...args);
});
// Notify the parent
$parentUpdateStore?.(...args);
});
$: _cleanup = (() => {
if (_cleanup) {
_cleanup();
}
if (!element) return null;
$notifyStore(StackMessage.Add, element);
return () => $notifyStore(StackMessage.Remove, element);
})();
$: _cleanup = (() => {
if (_cleanup) {
_cleanup();
}
if (!element) return null;
$notifyStore(StackMessage.Add, element);
return () => $notifyStore(StackMessage.Remove, element);
})();
</script>
<slot />