MCPcopy Create free account
hub / github.com/ampproject/amphtml / slowScan_

Method slowScan_

extensions/amp-bind/0.1/bind-impl.js:1578–1594  ·  view source on GitHub ↗

* Removes bindings for nodes in `remove`, then scans for bindings in `add`. * Return promise that resolves upon completion with struct containing number * of removed and added bindings. * @param {!Array<!Node>} addedNodes * @param {!Array<!Node>} removedNodes * @param {string=} label

(addedNodes, removedNodes, label = 'rescan.slow')

Source from the content-addressed store, hash-verified

1576 * @private
1577 */
1578 slowScan_(addedNodes, removedNodes, label = 'rescan.slow') {
1579 let removed = 0;
1580 return this.removeBindingsForNodes_(removedNodes)
1581 .then((r) => {
1582 removed = r;
1583 return this.addBindingsForNodes_(addedNodes);
1584 })
1585 .then((added) => {
1586 dev().info(
1587 TAG,
1588 '%s: delta=%s, total=%s',
1589 label,
1590 added - removed,
1591 this.numberOfBindings()
1592 );
1593 });
1594 }
1595
1596 /**
1597 * Helper for invoking a method on web worker.

Callers 2

rescan_Method · 0.95
onDomUpdate_Method · 0.95

Calls 6

addBindingsForNodes_Method · 0.95
numberOfBindingsMethod · 0.95
devFunction · 0.90
infoMethod · 0.80
thenMethod · 0.45

Tested by

no test coverage detected