MCPcopy
hub / github.com/statelyai/xstate / execute

Function execute

packages/core/test/transition.test.ts:434–444  ·  view source on GitHub ↗
(action: ExecutableActionsFrom<typeof machine>)

Source from the content-addressed store, hash-verified

432 });
433
434 async function execute(action: ExecutableActionsFrom<typeof machine>) {
435 if (action.type === 'xstate.raise' && action.params.delay) {
436 const currentTime = Date.now();
437 const startedAt = currentTime;
438 const elapsed = currentTime - startedAt;
439 const timeRemaining = Math.max(0, action.params.delay - elapsed);
440
441 await new Promise((res) => setTimeout(res, timeRemaining));
442 postEvent(action.params.event);
443 }
444 }
445
446 // POST /workflow
447 async function postStart() {

Callers 2

postStartFunction · 0.85
postEventFunction · 0.85

Calls 7

resolveReferencedActorFunction · 0.90
toPromiseFunction · 0.90
createActorFunction · 0.90
createDoneActorEventFunction · 0.90
postEventFunction · 0.85
nowMethod · 0.80
startMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…