1 2 3 4 5 6 7 8 9 10 11 | 1 1 17 39 16 23 | import {distinctUntilChanged} from '../distinctUntilChanged'; export function distinctUntilKeyChanged<T>(key: string, compare?: (x: any, y: any) => boolean, thisArg?: any) { return distinctUntilChanged.call(this, function(x, y) { if (compare) { return compare.call(thisArg, x[key], y[key]); } return x[key] === y[key]; }); } |