Skip to content

Commit

Permalink
Fix useActor send types for ActorLogic (#4604)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkofh authored Dec 18, 2023
1 parent ae0b05f commit 3ad929e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-dragons-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@xstate/vue': patch
---

The `useActor` hook now correctly types it's `send` function when passed an `ActorLogic`.
3 changes: 1 addition & 2 deletions packages/xstate-vue/src/useActor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
ActorOptions,
ActorRefFrom,
AnyActorLogic,
EventFrom,
Snapshot,
SnapshotFrom
} from 'xstate';
Expand All @@ -16,7 +15,7 @@ export function useActor<TLogic extends AnyActorLogic>(
options?: ActorOptions<TLogic>
): {
snapshot: Ref<SnapshotFrom<TLogic>>;
send: (event: EventFrom<TLogic>) => void;
send: (event: ActorRefFrom<TLogic>['send']) => void;
actorRef: ActorRefFrom<TLogic>;
};
export function useActor(
Expand Down

0 comments on commit 3ad929e

Please sign in to comment.