refactor
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
export interface IEntity<Id = string> {
|
||||
readonly id: Id;
|
||||
}
|
||||
|
||||
export abstract class Entity<Id> implements IEntity<Id> {
|
||||
protected constructor(readonly id: Id) {}
|
||||
|
||||
equals(other?: Entity<Id>): boolean {
|
||||
return !!other && this.id === other.id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user