1.16.0 - 2022-01-12
Added
- Entity: added method
isEqual
to compare current instance with another one.
- ValueObject: added method
isEqual
to compare current instance with another one. Issue 27
class EntityExample extends Entity<Props>{
private constructor(props: Props) {
super(props)
}
public static create(props: Props): Result<EntityExample> {
return Ok(new EntityExample(props));
}
}
const a = EntityExample.create({...props, id }).value();
const b = EntityExample.create({...props, id }).value();
console.log(a.isEqual(b));
> true