Skip to content

Commit

Permalink
chore: more type tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
tivac committed Dec 31, 2024
1 parent 164309c commit 2c1cd7a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/component-tree.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @import { AnyMachineSnapshot, AnyActor, EventObject } from "xstate"
* @import { AnyMachineSnapshot, AnyActor, EventObject, SendActionOptions } from "xstate"
*/

/**
Expand Down Expand Up @@ -518,9 +518,10 @@ class ComponentTree {
}

/**
* @callback Broadcast Send an event to the service and all its children
* @param {import("xstate").EventObject} event XState event to send
* @param {import("xstate").SendActionOptions} [options] XState options to send
* Send an event to the actor and all its children
*
* @param {EventObject} event XState event to send
* @param {SendActionOptions} [options] XState options to send
*/
broadcast(event, options) {
this._actors.forEach(({ actor }) => {
Expand Down Expand Up @@ -576,8 +577,8 @@ class ComponentTree {
/**
* Send an event to the root machine only
*
* @param {import("xstate").EventObject[]} event Event to send
* @returns {import("xstate").AnyState} Resulting state
* @param {EventObject[]} event Event to send
* @returns {AnyMachineSnapshot} Resulting state
*/
send(...event) {
return this._actors.get(this.id)?.actor?.send(...event);
Expand Down

0 comments on commit 2c1cd7a

Please sign in to comment.