-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7377971
commit 99bc5fb
Showing
2 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
'xstate': patch | ||
--- | ||
|
||
The `SpawnedActorRef` TypeScript interface has been deprecated in favor of a unified `ActorRef` interface, which contains the following: | ||
|
||
```ts | ||
interface ActorRef<TEvent extends EventObject, TEmitted = any> | ||
extends Subscribable<TEmitted> { | ||
send: (event: TEvent) => void; | ||
id: string; | ||
subscribe(observer: Observer<T>): Subscription; | ||
subscribe( | ||
next: (value: T) => void, | ||
error?: (error: any) => void, | ||
complete?: () => void | ||
): Subscription; | ||
getSnapshot: () => TEmitted | undefined; | ||
} | ||
``` | ||
|
||
For simpler actor-ref-like objects, the `BaseActorRef<TEvent>` interface has been introduced. | ||
|
||
```ts | ||
interface BaseActorRef<TEvent extends EventObject> { | ||
send: (event: TEvent) => void; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters