( /** * The entity type name. */ type: Type, /** * The schema definition for messages that the entity is capable of * processing. */ protocol: RpcGroup.RpcGroup<Rpcs> )
| 363 | * @category constructors |
| 364 | */ |
| 365 | export const fromRpcGroup = <const Type extends string, Rpcs extends Rpc.Any>( |
| 366 | /** |
| 367 | * The entity type name. |
| 368 | */ |
| 369 | type: Type, |
| 370 | /** |
| 371 | * The schema definition for messages that the entity is capable of |
| 372 | * processing. |
| 373 | */ |
| 374 | protocol: RpcGroup.RpcGroup<Rpcs> |
| 375 | ): Entity<Type, Rpcs> => { |
| 376 | const self = Object.create(Proto) |
| 377 | self.type = EntityType.make(type) |
| 378 | self.protocol = protocol |
| 379 | self.getShardGroup = Context.get(protocol.annotations, ShardGroup) |
| 380 | return self |
| 381 | } |
| 382 | |
| 383 | /** |
| 384 | * Creates a new `Entity` of the specified `type` which will accept messages |
no test coverage detected