react-code-dataset / next.js /test /development /app-dir /server-components-hmr-cache /lib /fetch-random-value.ts
Download next.js/test/development/app-dir/server-components-hmr-cache/lib/fetch-random-value.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 244 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/server-components-hmr-cache/lib/fetch-random-value.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/app-dir/server-components-hmr-cache/lib/fetch-random-value.ts
-
curl -L -o fetch-random-value.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/server-components-hmr-cache/lib/fetch-random-value.ts
244 Bytes
| export async function fetchRandomValue(key: string) { | |
| const url = new URL('https://next-data-api-endpoint.vercel.app/api/random') | |
| url.searchParams.set('key', key) | |
| const res = await fetch(url, { cache: 'no-store' }) | |
| return res.text() | |
| } | |