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 error broadcasting #67

Merged
merged 2 commits into from
Nov 4, 2019
Merged

Fix error broadcasting #67

merged 2 commits into from
Nov 4, 2019

Conversation

shuding
Copy link
Member

@shuding shuding commented Nov 3, 2019

cc @pacocoursey as we discussed somewhere else:

Currently if there're multiple SWR hooks sharing the same key, and one of them revalidates, it will broadcast the updated state to others (so we can deduplicate concurrent requests). But it only broadcasts data updates, not errors. This PR fixes the bug.

Also, some tiny performance improvements are made (using unstable_batchedUpdates and reducing the number of cache reads), and related tests are added.

Copy link
Contributor

@pacocoursey pacocoursey left a comment

Choose a reason for hiding this comment

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

Looks good! Nice tests as well

@shuding
Copy link
Member Author

shuding commented Nov 4, 2019

Thanks!

@shuding shuding merged commit 7ce0628 into master Nov 4, 2019
@shuding shuding deleted the fix-error-broadcasting branch November 4, 2019 22:01
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.

None yet

2 participants