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 }); } }