Value objects are objects that matter only as the combination of their attributes.
Two value objects with the same values for all their attributes are considered equal.
Example:
class Address extends ValueObject<{ street: string; streetNumber: string }> {
}
const address = new Address({ street: 'Street A' })
A value object's representation.
Value objects are objects that matter only as the combination of their attributes. Two value objects with the same values for all their attributes are considered equal.
Example:
class Address extends ValueObject<{ street: string; streetNumber: string }> { } const address = new Address({ street: 'Street A' })