igniteui-react-core
Version:
Ignite UI React Core.
31 lines (30 loc) • 870 B
JavaScript
import { IgCollection } from './IgCollection';
import { SyncableObservableCollection$2 } from './SyncableObservableCollection$2';
import { Base } from "./type";
export class IgrObjectCollection extends IgCollection {
constructor(list) {
super();
if (list) {
for (let i = 0; i < list.length; i++) {
this.add(list[i]);
}
}
}
_createInnerColl() {
let coll = new SyncableObservableCollection$2(Base.$type, Base.$type, 0);
coll.compare = (ext, int) => {
let comp = ext;
if (comp.equals) {
return comp.equals(int);
}
return comp === int;
};
coll.createTo = (ext) => {
return ext;
};
coll.createFrom = (int) => {
return int;
};
return coll;
}
}