( /** * The entity type name. */ type: Type, /** * The schema definition for messages that the entity is capable of * processing. */ protocol: RpcGroup.RpcGroup<Rpcs> )
| 408 | * @since 4.0.0 |
| 409 | */ |
| 410 | export const fromRpcGroup = <const Type extends string, Rpcs extends Rpc.Any>( |
| 411 | /** |
| 412 | * The entity type name. |
| 413 | */ |
| 414 | type: Type, |
| 415 | /** |
| 416 | * The schema definition for messages that the entity is capable of |
| 417 | * processing. |
| 418 | */ |
| 419 | protocol: RpcGroup.RpcGroup<Rpcs> |
| 420 | ): Entity<Type, Rpcs> => { |
| 421 | const self = Object.create(Proto) |
| 422 | self.type = EntityType.make(type) |
| 423 | self.protocol = protocol |
| 424 | self.getShardGroup = Context.get(protocol.annotations, ShardGroup) |
| 425 | return self |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | * Creates a new `Entity` of the specified `type` which will accept messages |
no test coverage detected