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

Function spawnChild

packages/core/src/actions/spawnChild.ts:194–236  ·  view source on GitHub ↗
(
  ...[
    src,
    { id, systemId, input, syncSnapshot = false } = {} as any
  ]: SpawnArguments<TContext, TExpressionEvent, TEvent, TActor>
)

Source from the content-addressed store, hash-verified

192 ];
193
194export function spawnChild<
195 TContext extends MachineContext,
196 TExpressionEvent extends EventObject,
197 TParams extends ParameterizedObject['params'] | undefined,
198 TEvent extends EventObject,
199 TActor extends ProvidedActor
200>(
201 ...[
202 src,
203 { id, systemId, input, syncSnapshot = false } = {} as any
204 ]: SpawnArguments<TContext, TExpressionEvent, TEvent, TActor>
205): ActionFunction<
206 TContext,
207 TExpressionEvent,
208 TEvent,
209 TParams,
210 TActor,
211 never,
212 never,
213 never,
214 never
215> {
216 function spawnChild(
217 _args: ActionArgs<TContext, TExpressionEvent, TEvent>,
218 _params: TParams
219 ) {
220 if (isDevelopment) {
221 throw new Error(`This isn't supposed to be called`);
222 }
223 }
224
225 spawnChild.type = 'xstate.spawnChild';
226 spawnChild.id = id;
227 spawnChild.systemId = systemId;
228 spawnChild.src = src;
229 spawnChild.input = input;
230 spawnChild.syncSnapshot = syncSnapshot;
231
232 spawnChild.resolve = resolveSpawn;
233 spawnChild.execute = executeSpawn;
234
235 return spawnChild;
236}

Callers 9

input.test.tsFile · 0.90
actions.test.tsFile · 0.90
system.test.tsFile · 0.90
spawnChild.test.tsFile · 0.90
logger.test.tsFile · 0.90
enterStatesFunction · 0.90
resolveEnqueueActionsFunction · 0.90
types.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…