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

bugfix: make suspense and revalidateIfStale work together #1851

Merged
merged 2 commits into from Feb 18, 2022
Merged

bugfix: make suspense and revalidateIfStale work together #1851

merged 2 commits into from Feb 18, 2022

Conversation

simowe
Copy link
Contributor

@simowe simowe commented Feb 10, 2022

Summary

Today, revalidateIfStale is ignored when using suspense: true.

This fix makes revalidateIfStale behave consistently with or without suspense

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 10, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8f6b489:

Sandbox Source
SWR-Basic Configuration
SWR-States Configuration
SWR-Infinite Configuration
SWR-SSR Configuration

Copy link
Member

@shuding shuding left a comment

Choose a reason for hiding this comment

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

Thanks! The fix looks good to me, would you mind also adding a test case to ensure it doesn't break in the future?

@simowe
Copy link
Contributor Author

simowe commented Feb 17, 2022

Thanks! The fix looks good to me, would you mind also adding a test case to ensure it doesn't break in the future?

Done!

Copy link
Member

@shuding shuding left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@shuding shuding merged commit c712631 into vercel:main Feb 18, 2022
@simowe
Copy link
Contributor Author

simowe commented Feb 21, 2022

Looks great, thank you!

No problem!

shuding pushed a commit that referenced this pull request Apr 10, 2022
* bugfix: make suspense and revalidateIfStale work together

* test: add test for revalidateIfStale used with suspense
@pkellner
Copy link

Does this mean the Suspense will be supported in V2? I got the feeling that there is a lot more to implementing suspense then is indicated here based on the discussions we've had.

nevilm-lt pushed a commit to nevilm-lt/swr-1 that referenced this pull request Apr 22, 2022
* bugfix: make suspense and revalidateIfStale work together

* test: add test for revalidateIfStale used with suspense
himanshiLt pushed a commit to himanshiLt/swr that referenced this pull request Jun 10, 2022
* bugfix: make suspense and revalidateIfStale work together

* test: add test for revalidateIfStale used with suspense
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

3 participants