Options
All
  • Public
  • Public/Protected
  • All
Menu

An entity's representation.

Entities are objects that have a distinct identity that runs through time and different representations.

Example:

class Post extends Entity<{ title: string; content: string }> {
  get title() {
    return this.props.title
  }

  get content() {
    return this.props.content
  }
}

const post = new Post({ title: 'Hello Rimo!', content: 'You are amazing :)' })
// post.id -> generated
// post.title -> 'Hello Rimo!'
// post.content -> 'You are amazing :)'

Type parameters

  • T

    The properties of this entity

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Protected _id

props

props: T = {} as T

Accessors

id

Methods

equals

  • equals(object?: Entity<T>): boolean

populate

  • populate(props: PartialDeep<T>): void

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Protected property
  • Private property
  • Static method

Generated using TypeDoc