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

Generalise the notifying semantics to freezing #223

Merged
merged 7 commits into from
May 28, 2024

Conversation

prophile
Copy link
Contributor

There are a couple of other cases where having the signal graph be frozen avoids some hard-to-specify and hard-to-reason-about behaviours, like calling .unwatch within a watched callback. Here we generalise the notifying trap to a general "freeze the signal graph" mechanism and use it to protect unwatched and watched callbacks.

As discussed in the community call 2024-05-12.

Fixes #211
Fixes #206

Thoughts?

@littledan littledan merged commit ebc7149 into tc39:main May 28, 2024
1 check passed
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.

Calling .watch inside a Computed callback watched callback calling .unwatch
2 participants