refactor(core): remove deprecated `TrackByFn` (#18757)
BREAKING CHANGE: `TrackByFn` has been removed because it was deprecated since v4. Use `TrackByFunction` instead. PR Close #18757
This commit is contained in:
parent
da14391cff
commit
596e9f4e04
|
@ -12,4 +12,4 @@
|
|||
* Change detection enables data binding in Angular.
|
||||
*/
|
||||
|
||||
export {ChangeDetectionStrategy, ChangeDetectorRef, CollectionChangeRecord, DefaultIterableDiffer, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers, NgIterable, PipeTransform, SimpleChange, SimpleChanges, TrackByFn, TrackByFunction, WrappedValue} from './change_detection/change_detection';
|
||||
export {ChangeDetectionStrategy, ChangeDetectorRef, CollectionChangeRecord, DefaultIterableDiffer, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers, NgIterable, PipeTransform, SimpleChange, SimpleChanges, TrackByFunction, WrappedValue} from './change_detection/change_detection';
|
||||
|
|
|
@ -18,7 +18,7 @@ export {ChangeDetectionStrategy, ChangeDetectorStatus, isDefaultChangeDetectionS
|
|||
export {DefaultIterableDifferFactory} from './differs/default_iterable_differ';
|
||||
export {DefaultIterableDiffer} from './differs/default_iterable_differ';
|
||||
export {DefaultKeyValueDifferFactory} from './differs/default_keyvalue_differ';
|
||||
export {CollectionChangeRecord, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, NgIterable, TrackByFn, TrackByFunction} from './differs/iterable_differs';
|
||||
export {CollectionChangeRecord, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, NgIterable, TrackByFunction} from './differs/iterable_differs';
|
||||
export {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs';
|
||||
export {PipeTransform} from './pipe_transform';
|
||||
|
||||
|
|
|
@ -82,7 +82,8 @@ export interface IterableChanges<V> {
|
|||
/** Iterate over all removed items. */
|
||||
forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
|
||||
|
||||
/** Iterate over all items which had their identity (as computed by the `trackByFn`) changed. */
|
||||
/** Iterate over all items which had their identity (as computed by the `TrackByFunction`)
|
||||
* changed. */
|
||||
forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;
|
||||
}
|
||||
|
||||
|
@ -101,7 +102,7 @@ export interface IterableChangeRecord<V> {
|
|||
/** The item. */
|
||||
readonly item: V;
|
||||
|
||||
/** Track by identity as computed by the `trackByFn`. */
|
||||
/** Track by identity as computed by the `TrackByFunction`. */
|
||||
readonly trackById: any;
|
||||
}
|
||||
|
||||
|
@ -110,14 +111,6 @@ export interface IterableChangeRecord<V> {
|
|||
*/
|
||||
export interface CollectionChangeRecord<V> extends IterableChangeRecord<V> {}
|
||||
|
||||
|
||||
/**
|
||||
* Nolonger used.
|
||||
*
|
||||
* @deprecated v4.0.0 - Use TrackByFunction instead
|
||||
*/
|
||||
export interface TrackByFn { (index: number, item: any): any; }
|
||||
|
||||
/**
|
||||
* An optional function passed into {@link NgForOf} that defines how to track
|
||||
* items in an iterable (e.g. fby index or id)
|
||||
|
|
|
@ -989,11 +989,6 @@ export declare class TestabilityRegistry {
|
|||
registerApplication(token: any, testability: Testability): void;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export interface TrackByFn {
|
||||
(index: number, item: any): any;
|
||||
}
|
||||
|
||||
/** @stable */
|
||||
export interface TrackByFunction<T> {
|
||||
(index: number, item: T): any;
|
||||
|
|
Loading…
Reference in New Issue