Skip to content
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

fix(ui/svelte): Allow class instances to be created as deriveds #5268

Merged
merged 3 commits into from
Mar 19, 2025

Conversation

elliott-with-the-longest-name-on-github
Copy link
Contributor

When creating class instances, this would throw an error:

const chat = $derived(new Chat());
chat.messages

...because the constructor was trying to modify state it didn't own. Hiding this modification (which is quite safe in reality) behind untrack fixes the issue.

@lgrammel
Copy link
Collaborator

There's an ESLint error that needs to be fixed (or it'll break main). Which bug does this fix? Or is the a new feature?

@lgrammel lgrammel merged commit d1ea22e into main Mar 19, 2025
8 checks passed
@lgrammel lgrammel deleted the elliott/fix-derived-reactivity branch March 19, 2025 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants