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

Improve readme #73

Merged
merged 4 commits into from Nov 4, 2019
Merged

Improve readme #73

merged 4 commits into from Nov 4, 2019

Conversation

shuding
Copy link
Member

@shuding shuding commented Nov 4, 2019

We see people confusing about fetch, package names and other use cases. This PR tries to improve the README based on the feedback.

Close #41, close #61.

@shuding
Copy link
Member Author

shuding commented Nov 4, 2019

To preview the rendered README: https://github.com/zeit/swr/tree/improve-readme

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.

Can we add a note describing that the key parameter can also be a function that throws, returns null, or returns falsy values that cancels the request?

Copy link
Contributor

@sergiodxa sergiodxa 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, way more detailed, maybe it should have use useSWRPages as part of the library API documentation?

@@ -182,6 +202,60 @@ function App () {
}
```

### Subscription (e.g.: socket.io)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this code be inside the examples folder?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sergiodxa Yeah, I think we can add this model to your localStorage example using the storage event. So we can sync the data without focusing on the other window.

Copy link
Member Author

Choose a reason for hiding this comment

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

Setting up socket.io for an example might be a bit overkill IMO.

@shuding
Copy link
Member Author

shuding commented Nov 4, 2019

@sergiodxa for useSWRPages, I want to ship #52 and some performance fixes before adding it to README, will do in 1~2 days.

@shuding shuding merged commit a2d700b into master Nov 4, 2019
@shuding shuding deleted the improve-readme branch November 4, 2019 22:59
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.

Describe installation process Support socket request like sockjs-client or socket.io ?
3 participants