Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Jul 22, 2022
1 parent 13714a6 commit ddfbe23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
export async function load() {
return {
props: {
// Needs to be an object, else Svelte will do by-value-comparison and skip rerender
// Needs to be an object, else Svelte will do by-value-comparison and skip rerender
obj: {}
}
};
}
</script>

<script>
import { session } from '$app/stores';
import { session } from '$app/stores';
/** @type {any} */
export let obj;
let count = 0;
$: obj && count++;
let count = 0;
$: obj && count++;
</script>

<h2>{count}</h2>
<button on:click={() => $session.calls = 123}>Update $session</button>
<button on:click={() => ($session.calls = 123)}>Update $session</button>
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<script context="module">
/** @type {import('@sveltejs/kit').Load} */
export async function load({ session }) {
session;
session;
return {
props: {
// Needs to be an object, else Svelte will do by-value-comparison and skip rerender
// Needs to be an object, else Svelte will do by-value-comparison and skip rerender
obj: {}
}
};
}
</script>

<script>
import { session } from '$app/stores';
import { session } from '$app/stores';
/** @type {any} */
export let obj;
let count = 0;
$: obj && count++;
let count = 0;
$: obj && count++;
</script>

<h2>{count}</h2>
<button on:click={() => $session.calls = 123}>Update $session</button>
<button on:click={() => ($session.calls = 123)}>Update $session</button>

0 comments on commit ddfbe23

Please sign in to comment.