mirror of
https://github.com/lainbo/component-party.git
synced 2026-04-05 13:09:03 +08:00
17 lines
377 B
Svelte
17 lines
377 B
Svelte
<script>
|
|
import { setContext } from "svelte";
|
|
import UserProfile from "./UserProfile.svelte";
|
|
import createUserStore from "./createUserStore.js";
|
|
|
|
const userStore = createUserStore({
|
|
id: 1,
|
|
username: "unicorn42",
|
|
email: "unicorn42@example.com",
|
|
});
|
|
|
|
setContext("user", userStore);
|
|
</script>
|
|
|
|
<h1>Welcome back, {$userStore.username}</h1>
|
|
<UserProfile />
|