register
@quik/entity / EntityStore / register
Function: register()
register(...
entities):void
Defined in: entity/src/store.ts:175
Register one or more entity constructors with the store.
This function adds entity classes to the internal registry by:
- Validating that each constructor has the required 'Entity' property
- Extracting the entity name and using it as the registry key
- Making the entity available for later retrieval and instantiation
Parameters
entities
...Constructor<QEntity>[]
Entity constructors to register
Returns
void
Example
// Register a single entity
EntityStore.register(UserEntity);
// Register multiple entities at once
EntityStore.register(UserEntity, ProductEntity, OrderEntity);
// After registration, entities can be retrieved and instantiated
const User = EntityStore.get('User');
const newUser = new User();