Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry committed Dec 2, 2021
1 parent 5870f03 commit 53e3628
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/Input/ComponentSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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`);
}
Expand Down Expand Up @@ -90,7 +90,7 @@
components.update(components => components.concat(component));
handle_select(component);
dispatch('add', {components: $components})
dispatch('add', { components: $components });
}
function isComponentNameUsed(editing) {
Expand Down
19 changes: 10 additions & 9 deletions src/Repl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -197,8 +198,8 @@
function beforeUnload(event) {
if ($components.find(component => component.modified)) {
event.preventDefault()
event.returnValue = ''
event.preventDefault();
event.returnValue = '';
}
}
Expand Down

0 comments on commit 53e3628

Please sign in to comment.