From 639f4b422adb0a6fc809161dd816d8382cf88138 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Thu, 19 Jun 2025 11:33:17 -0400 Subject: Boot the client by consuming events. We use the same event processing glue that the client has for keeping up with live events, which means that a significant chunk of state management code goes away entirely. --- ui/lib/state/remote/users.svelte.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'ui/lib/state/remote/users.svelte.js') diff --git a/ui/lib/state/remote/users.svelte.js b/ui/lib/state/remote/users.svelte.js index a15d1da..391ab3a 100644 --- a/ui/lib/state/remote/users.svelte.js +++ b/ui/lib/state/remote/users.svelte.js @@ -16,16 +16,7 @@ export class User { } export class Users { - all = $state(); - - static boot(users) { - const all = new SvelteMap(users.map((user) => [user.id, User.boot(user)])); - return new Users({ all }); - } - - constructor({ all }) { - this.all = all; - } + all = $state(new SvelteMap()); add({ id, name }) { this.all.set(id, new User(id, name)); -- cgit v1.2.3