-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@xstate/react] Add support for getShapshot()
#2223
Conversation
🦋 Changeset detectedLatest commit: b50fc87 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/core/src/types.ts
Outdated
@@ -1275,18 +1275,25 @@ export interface ActorRef<TEvent extends EventObject, TEmitted = any> | |||
send: Sender<TEvent>; | |||
} | |||
|
|||
export interface SpawnedActorRef<TEvent extends EventObject, TEmitted = any> | |||
extends ActorRef<TEvent, TEmitted> { | |||
export interface SpawnedActorRef< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writing down somewhere what is considered to be an Actor, ActorRef and SpawnedActorRef would be very helpful - I often have to recheck this on my own in the codebase as it's not entirely intuitive for me (especially the distinction between ActorRef
and SpawnedActorRef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could write that down right here to start 😁 Pretty please!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added as todo here: https://github.com/davidkpiano/xstate/projects/1#card-61626855
actor.getSnapshot()
getShapshot()
This PR adds support for actors with the actor.getSnapshot() method in the useActor(...) hook.