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

Code refactoring #1077

Merged
merged 2 commits into from
Mar 28, 2021
Merged

Code refactoring #1077

merged 2 commits into from
Mar 28, 2021

Conversation

shuding
Copy link
Member

@shuding shuding commented Mar 28, 2021

This PR moves the argument resolution logic into a standalone function. It will empower future high-level hooks that are built on top of useSWR such as usePassive (name TBD.), and it has already simplified the current useSWR and useSWRInfinite hooks logic. Also to unify the behavior of useSWRInfinite, it is now allowed to pass null as fetcher too.

@shuding shuding requested a review from huozhi March 28, 2021 08:48
@codesandbox-ci
Copy link

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 de9db65:

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

Copy link
Member

@huozhi huozhi left a comment

Choose a reason for hiding this comment

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

Super clean!

@shuding shuding merged commit 4d56c49 into master Mar 28, 2021
@shuding shuding deleted the code-refactoring branch March 28, 2021 08:53
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