diff --git a/.changeset/famous-dingos-tease.md b/.changeset/famous-dingos-tease.md new file mode 100644 index 0000000000..85b580366b --- /dev/null +++ b/.changeset/famous-dingos-tease.md @@ -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(); +```