waitFor
Callable
Type parameters
- TActorRef: ActorRef<any, any>
Parameters
actorRef: TActorRef
The actor ref to subscribe to
predicate: (emitted: SnapshotFrom<TActorRef>) => boolean
Determines if a value matches the condition to wait for
optionaloptions: Partial<WaitForOptions>
Returns Promise<SnapshotFrom<TActorRef>>
A promise that eventually resolves to the emitted value that matches the condition
Subscribes to an actor ref and waits for its emitted value to satisfy a predicate, and then resolves with that value. Will throw if the desired state is not reached after a timeout (defaults to 10 seconds).