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

Method send

packages/core/src/createActor.ts:749–756  ·  view source on GitHub ↗

* Sends an event to the running Actor to trigger a transition. * * @param event The event to send

(event: EventFromLogic<TLogic>)

Source from the content-addressed store, hash-verified

747 * @param event The event to send
748 */
749 public send(event: EventFromLogic<TLogic>) {
750 if (isDevelopment && typeof event === 'string') {
751 throw new Error(
752 `Only event objects may be sent to actors; use .send({ type: "${event}" }) instead`
753 );
754 }
755 this.system._relay(undefined, this, event);
756 }
757
758 private attachDevTools(): void {
759 const { devTools } = this.options;

Callers 15

CounterFunction · 0.80
index.test.tsxFile · 0.80
types.test.tsxFile · 0.80
validate.test.tsFile · 0.80
atom.test.tsFile · 0.80
fromStore.test.tsFile · 0.80
store.test.tsFile · 0.80
rehydrateStoreFunction · 0.80
select.test.tsFile · 0.80
fromStoreFunction · 0.80
createStoreCoreFunction · 0.80
useActor.test.tsFile · 0.80

Calls

no outgoing calls

Tested by 15

CounterFunction · 0.64
acceptActorRefFunction · 0.64
runTestToCompletionFunction · 0.64
countReducerFunction · 0.64
AppFunction · 0.64
ElementFunction · 0.64
AppFunction · 0.64
ComponentFunction · 0.64
AppFunction · 0.64
ChildTestFunction · 0.64
TestFunction · 0.64
ChildTestFunction · 0.64