Class ReferableMapEntity<T>

The ReferableMapEntity() class encapsulates any DataType as an identified entity (an entity, which contains an ID and changes can be mutable and push to the database).

Type Parameters

Hierarchy

  • ReferableMapEntity

Constructors

Properties

alive: boolean = true
changes: Partial<T> = {}
content: T
document: undefined | string
saved: Partial<T> = {}
synthesized: boolean

The synthesized property determines whether the object is newly created in script or retrieved from the existing source.

(in-script created ReferableMapEntity will always be marked as synthesized and will be created when push to the database)

Methods

  • The deleteField() method deletes the provided field from the entity.

    Type Parameters

    • U extends string | number | symbol

    Parameters

    • field: U

      Field name.

    Returns void

  • The get() method gets the value of the provided field.

    Type Parameters

    • U extends string | number | symbol

    Parameters

    • field: U

      Field name.

    Returns T[U]

  • The isEdited() method determines whether the entity has been edited or not.

    Returns boolean

  • The setSynthesized() method sets the synthesized property.

    Parameters

    • syn: boolean

      value

    Returns void

Generated using TypeDoc