From 81958266f59b07f91298da7ee1f14a40da777496 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 2 Dec 2021 14:11:19 -0500 Subject: [PATCH] code formatting --- src/Input/ComponentSelector.svelte | 4 ++-- src/Repl.svelte | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Input/ComponentSelector.svelte b/src/Input/ComponentSelector.svelte index 0e45004..0e4b74d 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; @@ -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..41a9915 100644 --- a/src/Repl.svelte +++ b/src/Repl.svelte @@ -48,8 +48,8 @@ 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 = ''; } }