diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-03-24 11:24:22 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-03-24 11:24:22 -0400 |
| commit | c3d774545cefd6168cfdc69c128a84bf9dee4776 (patch) | |
| tree | 710980e34acf4a84594872df93aa3fc13be4d7ab /ui/lib/state/remote/users.svelte.js | |
| parent | d581218e8907b9ae2b5df5457b47d788cd8a67ff (diff) | |
Rename `login` to `user` in the client.
Diffstat (limited to 'ui/lib/state/remote/users.svelte.js')
| -rw-r--r-- | ui/lib/state/remote/users.svelte.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/lib/state/remote/users.svelte.js b/ui/lib/state/remote/users.svelte.js new file mode 100644 index 0000000..617084f --- /dev/null +++ b/ui/lib/state/remote/users.svelte.js @@ -0,0 +1,18 @@ +import { SvelteMap } from 'svelte/reactivity'; + +export class Users { + all = $state(); + + static boot(users) { + const all = new SvelteMap(users.map((user) => [user.id, user])); + return new Users({ all }); + } + + constructor({ all }) { + this.all = all; + } + + add({ id, name }) { + this.all.set(id, { id, name }); + } +} |
