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: improve effect over-fire on store subscription init #10535

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Feb 19, 2024

Fixes #10505

Copy link

changeset-bot bot commented Feb 19, 2024

🦋 Changeset detected

Latest commit: 0694c7e

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

import { log } from './log';

const storeCount = writable(0)
let count = $state(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make this state, only to untrack it? Couldn't we just do let count = 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really have any bearing on this test (which I just copied from the repl).

@Rich-Harris Rich-Harris mentioned this pull request Feb 19, 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.

Svelte 5: stores cause $effect run twice on initial load
2 participants