Skip to content

chore: tidy up effect init #10931

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

Merged
merged 5 commits into from
Mar 26, 2024
Merged

chore: tidy up effect init #10931

merged 5 commits into from
Mar 26, 2024

Conversation

Rich-Harris
Copy link
Member

The only place we call schedule_effect(effect, true) is inside create_effect. We should therefore move the contents of the if (sync) block inside schedule_effect into create_effect, so that we only need to do that check once, instead of every time the effect is scheduled.

A couple of other small tweaks:

  • moved the effect.f |= EFFECT_RAN into create_effect instead of schedule_effect. (We only care about this flag for sync effects)
  • moved set_signal_status(effect, CLEAN) into execute_effect — previously, it was being called adjacently to execute_effect, but inconsistently (missing in one case, before execute_effect in another, after it in a third)

Copy link

changeset-bot bot commented Mar 25, 2024

⚠️ No Changeset found

Latest commit: 1d706db

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@Rich-Harris Rich-Harris changed the title Effect init chore: tidy up effect init Mar 25, 2024
@trueadm trueadm merged commit 9bbc332 into main Mar 26, 2024
@trueadm trueadm deleted the effect-init branch March 26, 2024 10:06
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