Skip to main content

has

@quik/entity


@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:

  1. Normalizing the provided entity name
  2. Checking if it exists in the internal entity registry
  3. 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');
}

See

  • get For retrieving the entity constructor if it exists
  • register For adding entities to the store