Files
gridpilot.gg/core/shared/domain/Entity.ts
2025-12-17 00:33:13 +01:00

11 lines
254 B
TypeScript

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;
}
}