MCPcopy
hub / github.com/nukeop/nuclear / postAction

Function postAction

packages/player/src/remoteControl/useRemoteActions.ts:20–30  ·  view source on GitHub ↗
(path: string, body?: unknown)

Source from the content-addressed store, hash-verified

18};
19
20const postAction = async (path: string, body?: unknown) => {
21 try {
22 await fetch(path, {
23 method: 'POST',
24 headers: body ? { 'Content-Type': 'application/json' } : undefined,
25 body: body ? JSON.stringify(body) : undefined,
26 });
27 } catch {
28 // SSE will push corrected state
29 }
30};
31
32export const useRemoteActions = (): RemoteActions => {
33 const getState = () => useRemoteStore.getState();

Callers 1

useRemoteActionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected