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

Function displayReducer

src/utils/display-observer.js:444–455  ·  view source on GitHub ↗

* @param {?boolean} acc * @param {?boolean|undefined} value * @return {?boolean}

(acc, value)

Source from the content-addressed store, hash-verified

442 * @return {?boolean}
443 */
444function displayReducer(acc, value) {
445 if (acc || value) {
446 // OR condition: one true - the result is true.
447 return true;
448 }
449 if (acc === false && value === false) {
450 // Reverse of OR: both must be false for the result to be false.
451 return false;
452 }
453 // Unknown.
454 return null;
455}
456
457/**
458 * @param {!Array<!ObserverDef>} observers

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected