reportUnhandledError.js:10
Uncaught Svelte error: state_unsafe_mutation
Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
ってエラー出てて
rxNostr.createConnectionStateObservable().subscribe((packet) => {
relayStateMap.update((current) => {
const newMap = new SvelteMap(current);
newMap.set(packet.from, packet.state);
return newMap;
});
});
で
relayStateMap: {
get: () => SvelteMap<string, ConnectionState>;
set: (value: SvelteMap<string, ConnectionState>) => void;
update: (updater: (current: SvelteMap<string, ConnectionState>) => SvelteMap<string, ConnectionState>) => void;
subscribe: (subscriber: (value: SvelteMap<string, ConnectionState>) => void) => () => void;
}
だけどどうしたらいい