W3cubDocs

/Angular 11

KeyValueChanges

interface

An object describing the changes in the Map or {[k:string]: string} since last time KeyValueDiffer#diff() was invoked.

interface KeyValueChanges<K, V> {
  forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
  forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
  forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
  forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
  forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
}

Methods

Iterate over all changes. KeyValueChangeRecord will contain information about changes to each item.

forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void

Parameters
fn (r: KeyValueChangeRecord) => void
Returns

void

Iterate over changes in the order of original Map showing where the original items have moved.

forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void

Parameters
fn (r: KeyValueChangeRecord) => void
Returns

void

Iterate over all keys for which values have changed.

forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void

Parameters
fn (r: KeyValueChangeRecord) => void
Returns

void

Iterate over all added items.

forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void

Parameters
fn (r: KeyValueChangeRecord) => void
Returns

void

Iterate over all removed items.

forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void

Parameters
fn (r: KeyValueChangeRecord) => void
Returns

void

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v11.angular.io/api/core/KeyValueChanges