Class representing an Entity Adapter.

Type Parameters

  • T extends IEntity = any

    The type of the entity.

Implements

Constructors

Properties

Accessors

Constructors

Properties

refresh: () => Promise<void>

Refreshes the entity data.

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

refresh

setData: (data: Partial<T> | (prevData: T) => Partial<T>) => Promise<void>

Sets the data for the object.

Type declaration

    • (data: Partial<T> | (prevData: T) => Partial<T>): Promise<void>
    • Parameters

      • data: Partial<T> | (prevData: T) => Partial<T>

        The data to set. Can be either a partial object of type T or a function that takes the previous data of type T and returns a partial object of type T.

      Returns Promise<void>

      • A Promise that resolves after the data is set.
toEntity: () => Entity<T>

Retrieves the current entity object.

Type declaration

toObject: () => T

Converts the current value of the _entity$ property to an object.

Type declaration

    • (): T
    • Returns T

      The _entity$ property value converted to an object.

toObject

Accessors

  • get id(): string | number

    Retrieve the ID of the current entity.

    Returns string | number

    The ID of the current entity.