You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently AnyActorSystem is used everywhere, rendering interface ActorSystem<T extends ActorSystemInfo> useless.
I would love to be able to pass in my own ActorSystemInfo so I can implement dependency injection pattern, allowing one actor to assume the existence of a set of other named actors within the system.
I propose this pattern:
// export type AnyActorSystem = DefaultActorSystem;exporttypeDefaultActorSystem=ActorSystem<DefaultActorSystemInfo>;interfaceDefaultActorSystemInfo{actors: ActorsInDefaultSystem;}exportinterfaceActorsInDefaultSystem{/** leave empty */}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently
AnyActorSystem
is used everywhere, renderinginterface ActorSystem<T extends ActorSystemInfo>
useless.I would love to be able to pass in my own
ActorSystemInfo
so I can implement dependency injection pattern, allowing one actor to assume the existence of a set of other named actors within the system.I propose this pattern:
Now I can specify in my "app.d.ts":
Now I type
system.get("myInjectedActor")
I get an actor ref with proper types, I know what events can be sent.Beta Was this translation helpful? Give feedback.
All reactions