* Read an actor’s snapshot synchronously. * * @remarks * The snapshot represent an actor's last emitted value. * * When an actor receives an event, its internal state may change. An actor * may emit a snapshot when a state transition occurs. * * Note that some actors, such as
()
| 808 | * @see {@link Actor.getPersistedSnapshot} to persist the internal state of an actor (which is more than just a snapshot). |
| 809 | */ |
| 810 | public getSnapshot(): SnapshotFrom<TLogic> { |
| 811 | if (isDevelopment && !this._snapshot) { |
| 812 | throw new Error( |
| 813 | `Snapshot can't be read while the actor initializes itself` |
| 814 | ); |
| 815 | } |
| 816 | return this._snapshot; |
| 817 | } |
| 818 | } |
| 819 | |
| 820 | export type RequiredActorOptionsKeys<TLogic extends AnyActorLogic> = |
no outgoing calls