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: ensure SvelteMap reactivity persists through deriveds #13877

Merged
merged 3 commits into from
Oct 24, 2024
Merged

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Oct 24, 2024

Closes #13817. Quite an edge-case but one we need to support. When using a SvelteMap inside a reactive context such as a derived for the first time, registering of dependencies that get "upgraded" from a version to a property source might get missed as the context hasn't yet been registered to the sources. To avoid this, we can further increment the version when a further set is applied to a SvelteMap property signal, and where that signal hasn't yet been wired up. The increment to version will ensure on stale references get hooked up accordingly.

Copy link

changeset-bot bot commented Oct 24, 2024

🦋 Changeset detected

Latest commit: 961044f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@trueadm trueadm merged commit 5a54ad9 into main Oct 24, 2024
7 checks passed
@trueadm trueadm deleted the svelte-map branch October 24, 2024 20:03
@github-actions github-actions bot mentioned this pull request Oct 24, 2024
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.

reactive variable using $state breaks when updated inside #await
2 participants