I have the following interface:
export interface IDateRangeOperation {
getDateRange(): DateRange;
}
And have the following class:
export class DefaultRangeItem {
name: String;
operation: IDateRangeOperation;
constructor(name: String, operation: IDateRangeOperation){
this.name = name;
this.operation = operation;
}
isEqual(defaultRangeItem: DefaultRangeItem): Boolean {
return this.name === defaultRangeItem.name;
}
getDateRange(): DateRange {
return this.operation.getDateRange();
}
}
I have several classes that Implements the IDateRangeOperation
What I want is a way to compare, in the isEqual function
, the operation object of the two DefaultRangesItems
(on that receives on the isEqual
function with the present on the current DefaultRangeItem
)