From 53e3628cafef6cbb39a09cb3be182d13e75d207e Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 2 Dec 2021 14:14:45 -0500 Subject: [PATCH] code formatting --- src/Input/ComponentSelector.svelte | 6 +++--- src/Repl.svelte | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Input/ComponentSelector.svelte b/src/Input/ComponentSelector.svelte index 0e45004..64b0c8b 100644 --- a/src/Input/ComponentSelector.svelte +++ b/src/Input/ComponentSelector.svelte @@ -4,7 +4,7 @@ export let handle_select; const { components, selected, request_focus, rebundle } = getContext('REPL'); - const dispatch = createEventDispatcher() + const dispatch = createEventDispatcher(); let editing = null; @@ -55,7 +55,7 @@ if (~index) { components.set($components.slice(0, index).concat($components.slice(index + 1))); - dispatch('remove', {components: $components}) + dispatch('remove', { components: $components }); } else { console.error(`Could not find component! That's... odd`); } @@ -90,7 +90,7 @@ components.update(components => components.concat(component)); handle_select(component); - dispatch('add', {components: $components}) + dispatch('add', { components: $components }); } function isComponentNameUsed(editing) { diff --git a/src/Repl.svelte b/src/Repl.svelte index 61689cc..18d9688 100644 --- a/src/Repl.svelte +++ b/src/Repl.svelte @@ -48,9 +48,9 @@ export function markSaved() { components.update(components => components.map(c => { - c.modified = false - return c - }) + c.modified = false; + return c; + }); ) selected.update(c => c); } @@ -142,16 +142,17 @@ // derived from `components` and `index` if (component.source != event.detail.value) { component.source = event.detail.value; - component.modified = true + component.modified = true; } return component; }); components.update(component => { - if (component.name === $selected.name) - return $selected + if (component.name === $selected.name) { + return $selected; + } - return component + return component; }); // recompile selected component @@ -197,8 +198,8 @@ function beforeUnload(event) { if ($components.find(component => component.modified)) { - event.preventDefault() - event.returnValue = '' + event.preventDefault(); + event.returnValue = ''; } }