-
Notifications
You must be signed in to change notification settings - Fork 29
React dispatcher freeze mechanism #46
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: aiden <aiden@million.dev>
|
Cursor Agent can help with this pull request. Just |
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
Co-authored-by: aiden <aiden@million.dev>
Co-authored-by: aiden <aiden@million.dev>
Rename freeze functionality to pause, update internal state names, and move tests to a new file. Co-authored-by: aiden <aiden@million.dev>
Add
freezeandisFreezeActivefunctions to block React state updates.Initial attempts to freeze updates by patching dispatchers were insufficient because React components capture their dispatch functions during the initial render, making them referentially stable. The revised implementation intercepts updates at the
queue.pendinglevel within each hook's queue, preventing updates from being enqueued. It also patches dispatchers to ensure new components mounted while frozen also respect the freeze.