Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`AnyActorRef` is problematic for some use cases, because the result of the `AnyActorRef['getSnapshot']` function is of type `any`. However, changing `AnyActorRef` to use a narrow type in `ActorRef`'s first type argument, `TSnapshot`, breaks conditional types which perform inference based on `TSnapshot`. This change introduces `SomeActorRef`, which is like `AnyActorRef`, but is not intended to be inferred from in future conditional types. A consumer can use `SomeActorRef` like so: ```ts const actor: SomeActorRef = getSomeActor(); // inferred as `Snapshot<unknown>` const snapshot = actor.getSnapshot(); // do things w/ snapshot ``` `AnyActorRef` would return `any` from `actor.getSnapshot()`, which make it unsuitable for this use-case in a strictly-typed environment.
- Loading branch information