MCPcopy Create free account
hub / github.com/angular/components / compareFn

Function compareFn

src/cdk/collections/selection.spec.ts:358–358  ·  view source on GitHub ↗
(x: Item, y: Item)

Source from the content-addressed store, hash-verified

356 it('should not empty selection when caling setSelection twice with comparable', () => {
357 type Item = {id: number};
358 const compareFn = (x: Item, y: Item) => x.id === y.id;
359 const model = new SelectionModel<Item>(false, [], false, compareFn);
360 model.setSelection({id: 1});
361 expect(model.selected).toEqual([{id: 1}]);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected