Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Dec 23, 2023
1 parent e591c6f commit 984bdfa
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .changeset/famous-dingos-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'xstate': minor
---

An actor being stopped can now be observed:

```ts
const actor = createActor(machine);

actor.subscribe({
next: (snapshot) => {
if (snapshot.status === 'stopped') {
console.log('Actor stopped');
}
}
});

actor.start();

// ...

actor.stop();
```

0 comments on commit 984bdfa

Please sign in to comment.