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 synchronous suspense cases on client-side #506

Merged
merged 3 commits into from
Jan 13, 2020
Merged

Conversation

kitten
Copy link
Member

@kitten kitten commented Jan 13, 2020

This is a combined set of quirks that needed to be fixed. This PR also simplified the toSuspenseSource implementation as a shorter one is possible.

Essentially wonka had a problem with forwarding values in a switchMap operator, when the value was sent immediately on subscription before the operator had time to start.

The react-wonka implementation on the other hand would send a teardown even after the component suspended, which isn't necessary.

Lastly, all combined, a teardown operation would be sent at the wrong time and when React unsuspended the subtree it would create two new subscriptions which would cause the latest subscription to always miss the newest result.

See: kitten/react-wonka#10
See: 0no-co/wonka#69

@kitten kitten force-pushed the fix/suspense-override branch from 508155c to 8dfe201 Compare January 13, 2020 19:01
@kitten kitten merged commit 46611ab into master Jan 13, 2020
@kitten kitten deleted the fix/suspense-override branch January 13, 2020 19:07
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