has
@quik/entity / EntityStore / has
Function: has()
has(
entity):boolean
Defined in: entity/src/store.ts:115
Checks if an entity is registered in the store.
This function verifies entity existence by:
- Normalizing the provided entity name
- Checking if it exists in the internal entity registry
- Returning a boolean indicating whether the entity is available
Parameters
entity
string | Constructor
Entity name or constructor to check
Returns
boolean
Example
// Check if an entity exists by name
if (EntityStore.has('User')) {
console.log('User entity is registered');
}
// Check if an entity exists by constructor
if (EntityStore.has(UserEntity)) {
console.log('User entity is registered');
}