-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Correct examples name in their package.json * Add a README to every example - How to download only this examples - How to install their dependencies and run it - How to deploy it to Now - What the examples are about * Remove yarn.lock files of each examples This way you will always get the latest version of SWR * Update examples package.json files to include react, react-dom and latest version of swr * Update README files to remove the command to install react, react-dom and swr
- Loading branch information
Showing
27 changed files
with
304 additions
and
49,211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# API Hooks | ||
|
||
## How to Use | ||
|
||
Download the example: | ||
|
||
```bash | ||
curl https://codeload.github.com/zeit/swr/tar.gz/master | tar -xz --strip=2 swr-master/examples/api-hooks | ||
cd api-hooks | ||
``` | ||
|
||
Install it and run: | ||
|
||
```bash | ||
yarn | ||
yarn dev | ||
# or | ||
npm install | ||
npm run dev | ||
``` | ||
|
||
Deploy it to the cloud with [now](https://zeit.co/home) ([download](https://zeit.co/download)) | ||
|
||
``` | ||
now | ||
``` | ||
|
||
## The Idea behind the Example | ||
|
||
Show how you could create custom hooks, using SWR internally, for your different data requirements and use them in your application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Basic TypeScript | ||
|
||
## How to Use | ||
|
||
Download the example: | ||
|
||
```bash | ||
curl https://codeload.github.com/zeit/swr/tar.gz/master | tar -xz --strip=2 swr-master/examples/basic-typescript | ||
cd basic-typescript | ||
``` | ||
|
||
Install it and run: | ||
|
||
```bash | ||
yarn | ||
yarn dev | ||
# or | ||
npm install | ||
npm run dev | ||
``` | ||
|
||
Deploy it to the cloud with [now](https://zeit.co/home) ([download](https://zeit.co/download)) | ||
|
||
``` | ||
now | ||
``` | ||
|
||
## The Idea behind the Example | ||
|
||
Show how to use the basic example along with TypeScript to type the data received from SWR. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.