-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$inspect shows empty state object using Classes #14988
Comments
looks it's happening in the
svelte/packages/svelte/src/internal/shared/clone.js Lines 119 to 127 in ab3290f
not sure what can be done here. maybe just return the uncloned value without even attempting to clone it if it doesn't match any of the known types above (Data, object, Map, Set, etc.)? Or, if |
Btw you can define a toJSON. method to specify how a class should be "snapshotted" |
Good to know, thanks @paoloricciuti. However that damages the out-of-the-box brevity of |
Why? You just need to make sure to add a |
Describe the bug
If a Class contains only $state runes, e.g.
$inspect shows an empty obj. Whereas if it contains methods, etc., $inspect has more information.
Is this expected?
Reproduction
Playground
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: