Download next.js/examples/cms-sanity/app/(blog)/actions.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 296 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-sanity/app/(blog)/actions.ts
- Command line
-
hf download 'hf://datasets/Devendra174/react-code-dataset/next.js/examples/cms-sanity/app/(blog)/actions.ts'
-
curl -L -o actions.ts 'https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-sanity/app/(blog)/actions.ts'
296 Bytes
| "use server"; | |
| import { draftMode } from "next/headers"; | |
| export async function disableDraftMode() { | |
| "use server"; | |
| await Promise.allSettled([ | |
| (await draftMode()).disable(), | |
| // Simulate a delay to show the loading state | |
| new Promise((resolve) => setTimeout(resolve, 1000)), | |
| ]); | |
| } | |