MCPcopy
hub / github.com/ampproject/amphtml / unlayoutCallback

Method unlayoutCallback

src/custom-element.js:1727–1739  ·  view source on GitHub ↗

* Requests the element to unload any expensive resources when the element * goes into non-visible state. The scope is up to the actual component. * * Calling this method on unbuilt or unupgraded element has no effect. * * @return {boolean} * @package @final * TODO(

()

Source from the content-addressed store, hash-verified

1725 * TODO(#31915): remove once R1 migration is complete.
1726 */
1727 unlayoutCallback() {
1728 assertNotTemplate(this);
1729 if (!this.isBuilt()) {
1730 return false;
1731 }
1732 this.signals_.signal(CommonSignals_Enum.UNLOAD);
1733 const isReLayoutNeeded = this.impl_.unlayoutCallback();
1734 if (isReLayoutNeeded) {
1735 this.reset_();
1736 }
1737 this.dispatchCustomEventForTesting(AmpEvents_Enum.UNLOAD);
1738 return isReLayoutNeeded;
1739 }
1740
1741 /** @private */
1742 unlayout_() {

Callers

nothing calls this directly

Calls 5

isBuiltMethod · 0.95
reset_Method · 0.95
assertNotTemplateFunction · 0.85
signalMethod · 0.45

Tested by

no test coverage detected