Download next.js/packages/next/src/client/app-call-server.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 507 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/client/app-call-server.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/client/app-call-server.ts
-
curl -L -o app-call-server.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/client/app-call-server.ts
507 Bytes
| import { startTransition } from 'react' | |
| import { ACTION_SERVER_ACTION } from './components/router-reducer/router-reducer-types' | |
| import { dispatchAppRouterAction } from './components/use-action-queue' | |
| export async function callServer(actionId: string, actionArgs: any[]) { | |
| return new Promise((resolve, reject) => { | |
| startTransition(() => { | |
| dispatchAppRouterAction({ | |
| type: ACTION_SERVER_ACTION, | |
| actionId, | |
| actionArgs, | |
| resolve, | |
| reject, | |
| }) | |
| }) | |
| }) | |
| } | |