Describe the bug
It seems that writable(...) and $state(...) behave differently when used with class instances.
For example, given the following class:
class Test {
test = 0;
}
• Using writable(new Test()) makes it reactive.
• However, using $state(new Test()) does not make it reactive.
This behavior is described in the migration guide, but I wanted to confirm if this is the intended design.
If it is, should we always use writable(...) for handling reactivity with class instances?
Playground example for reference:
https://svelte.dev/playground/74b96807cf2a405984f202fe1c8a01cb?version=5.2.7
Reproduction
https://svelte.dev/playground/74b96807cf2a405984f202fe1c8a01cb?version=5.2.7
Logs
No response
System Info
Severity
annoyance