MCPcopy Create free account
hub / github.com/UI5/webcomponents / _invalidate

Function _invalidate

packages/base/src/UI5Element.ts:122–144  ·  view source on GitHub ↗

* Triggers re-rendering of a UI5Element instance due to state change. * @param {ChangeInfo} changeInfo An object with information about the change that caused invalidation. * @private

(this: UI5Element, changeInfo: ChangeInfo)

Source from the content-addressed store, hash-verified

120 * @private
121 */
122function _invalidate(this: UI5Element, changeInfo: ChangeInfo) {
123 // Invalidation should be suppressed: 1) before the component is rendered for the first time 2) and during the execution of onBeforeRendering
124 // This is necessary not only as an optimization, but also to avoid infinite loops on invalidation between children and parents (when invalidateOnChildChange is used)
125 if (this._suppressInvalidation) {
126 return;
127 }
128
129 const ctor = this.constructor as typeof UI5Element;
130
131 // Skip re-rendering of language-aware components while language-specific data (e.g., CLDR, language bundles) is still loading.
132 // Once all necessary language data has been loaded, the language change
133 // will trigger a re-render of all language-aware components.
134 if (ctor.getMetadata().isLanguageAware() && getLanguageChangePending()) {
135 return;
136 }
137
138 // Call the onInvalidation hook
139 this.onInvalidation(changeInfo);
140
141 this._changedState.push(changeInfo);
142 renderDeferred(this);
143 this._invalidationEventProvider.fireEvent("invalidate", { ...changeInfo, target: this });
144}
145
146/**
147 * looks up a property descsriptor including in the prototype chain

Callers

nothing calls this directly

Calls 7

getLanguageChangePendingFunction · 0.85
renderDeferredFunction · 0.85
isLanguageAwareMethod · 0.80
getMetadataMethod · 0.80
pushMethod · 0.80
fireEventMethod · 0.80
onInvalidationMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…