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

Possible to miss update? #29

Closed
csr632 opened this issue Dec 1, 2020 · 2 comments
Closed

Possible to miss update? #29

csr632 opened this issue Dec 1, 2020 · 2 comments

Comments

@csr632
Copy link
Contributor

csr632 commented Dec 1, 2020

If an update happens before useIsomorphicLayoutEffect is triggered, where listener is added, the dispatch of consumer will not be called(because listener has not been added yet). And it will stay at the old state forever.

@dai-shi
Copy link
Owner

dai-shi commented Dec 1, 2020

As far as I understand, child effects fire before parent effect, so should be fine?
Is it theoretical, or can you create a repro? I might be misunderstanding something.

@csr632
Copy link
Contributor Author

csr632 commented Dec 3, 2020

Yes I just realize you only emit events in Provider's useLayoutEffect. So consumers won't miss any events.

@csr632 csr632 closed this as completed Dec 3, 2020
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

No branches or pull requests

2 participants