Skip to content

Commit

Permalink
fix(logging): ignore internal xstate events
Browse files Browse the repository at this point in the history
  • Loading branch information
UberMouse committed Aug 1, 2024
1 parent 68b5eeb commit f973a38
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/xstateTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ export function buildRootComponent<TMachine extends AnyXstateTreeMachine>(
console.log(`[xstate-tree] actor spawned: ${event.actorRef.id}`);
break;
case "@xstate.event":
// Ignore internal events
if (event.event.type.includes("xstate.")) {
return;
}

console.log(
`[xstate-tree] event: ${
event.sourceRef ? event.sourceRef.id : "UNKNOWN"
Expand Down

0 comments on commit f973a38

Please sign in to comment.