securityos/node_modules/next/dist/esm/client/app-call-server.js

17 lines
508 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
import { getServerActionDispatcher } from "./components/app-router";
export async function callServer(actionId, actionArgs) {
const actionDispatcher = getServerActionDispatcher();
if (!actionDispatcher) {
throw new Error("Invariant: missing action dispatcher.");
}
return new Promise((resolve, reject)=>{
actionDispatcher({
actionId,
actionArgs,
resolve,
reject
});
});
}
//# sourceMappingURL=app-call-server.js.map