Skip to content

Commit 14c24cc

Browse files
committed
docs: update subscription example
1 parent 043b9e4 commit 14c24cc

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

examples/subscription/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Subscription
2+
3+
## One-Click Deploy
4+
5+
Deploy your own SWR project with Vercel.
6+
7+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?s=https://github.com/vercel/swr/tree/main/examples/subscription)
8+
9+
## How to Use
10+
11+
Download the example:
12+
13+
```bash
14+
curl https://codeload.github.com/vercel/swr/tar.gz/main | tar -xz --strip=2 swr-main/examples/storage-tab-sync
15+
cd storage-tab-sync
16+
```
17+
18+
Install it and run:
19+
20+
```bash
21+
yarn
22+
yarn dev
23+
# or
24+
npm install
25+
npm run dev
26+
```
27+
28+
## The Idea behind the Example
29+
30+
Show how you could use SWR to synchronize localStorage values between tabs.

examples/subscription/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "subscription",
3+
"private": true,
4+
"license": "MIT",
5+
"dependencies": {
6+
"next": "latest",
7+
"react": "latest",
8+
"react-dom": "latest",
9+
"swr": "latest"
10+
},
11+
"scripts": {
12+
"dev": "next",
13+
"start": "next start",
14+
"build": "next build"
15+
}
16+
}

0 commit comments

Comments
 (0)