diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-03-23 14:33:07 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-03-23 14:33:07 -0400 |
| commit | 876472299d67f8fe3a789b7777b9d8ee44297b23 (patch) | |
| tree | db62f5d1e15d871f8a73ce20b40cd53053d12f85 /ui/lib/state/remote/logins.svelte.js | |
| parent | fa0f653f141efee3f5a01e1fa696d29140ec12c2 (diff) | |
| parent | f788ea84e25a4f7216ca0604aeb216346403b6ef (diff) | |
Merge branch 'prop/restartable-state'
Diffstat (limited to 'ui/lib/state/remote/logins.svelte.js')
| -rw-r--r-- | ui/lib/state/remote/logins.svelte.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/lib/state/remote/logins.svelte.js b/ui/lib/state/remote/logins.svelte.js new file mode 100644 index 0000000..d19068d --- /dev/null +++ b/ui/lib/state/remote/logins.svelte.js @@ -0,0 +1,18 @@ +import { SvelteMap } from 'svelte/reactivity'; + +export class Logins { + all = $state(); + + static boot(logins) { + const all = new SvelteMap(logins.map((login) => [login.id, login])); + return new Logins({ all }); + } + + constructor({ all }) { + this.all = all; + } + + add({ id, name }) { + this.all.set(id, { id, name }); + } +} |
