-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13714a6
commit ddfbe23
Showing
2 changed files
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
packages/kit/test/apps/basics/src/routes/load/change-detection/session/used.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |