MCPcopy
hub / github.com/angular-ui/ui-grid / recordChanges

Function recordChanges

lib/test/angular/1.8.0/angular.js:11481–11500  ·  view source on GitHub ↗
(key, currentValue, previousValue)

Source from the content-addressed store, hash-verified

11479 });
11480
11481 function recordChanges(key, currentValue, previousValue) {
11482 if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) {
11483 // If we have not already scheduled the top level onChangesQueue handler then do so now
11484 if (!onChangesQueue) {
11485 scope.$$postDigest(flushOnChangesQueue);
11486 onChangesQueue = [];
11487 }
11488 // If we have not already queued a trigger of onChanges for this controller then do so now
11489 if (!changes) {
11490 changes = {};
11491 onChangesQueue.push(triggerOnChangesHook);
11492 }
11493 // If the has been a change on this property already then we need to reuse the previous value
11494 if (changes[key]) {
11495 previousValue = changes[key].previousValue;
11496 }
11497 // Store this change
11498 changes[key] = new SimpleChange(previousValue, currentValue);
11499 }
11500 }
11501
11502 function triggerOnChangesHook() {
11503 destination.$onChanges(changes);

Callers 1

Calls 2

isFunctionFunction · 0.70
simpleCompareFunction · 0.70

Tested by

no test coverage detected