MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / onChange

Method onChange

packages/core/ui/styling/style-scope.ts:548–558  ·  view source on GitHub ↗

* Called when a change had occurred that may invalidate the statically matching selectors (class, id, ancestor selectors). * As a result, at some point in time, the selectors matched have to be requerried from the style scope and applied to the view.

()

Source from the content-addressed store, hash-verified

546 * As a result, at some point in time, the selectors matched have to be requerried from the style scope and applied to the view.
547 */
548 public onChange(): void {
549 const view = this.viewRef.get();
550 if (view && view.isLoaded) {
551 this.unsubscribeFromDynamicUpdates();
552 this.updateMatch();
553 this.subscribeForDynamicUpdates();
554 this.updateDynamicState();
555 } else {
556 this._matchInvalid = true;
557 }
558 }
559
560 /**
561 * Checks whether style scope and CSS state selectors are in sync.

Callers 1

_onCssStateChangeFunction · 0.80

Calls 5

updateMatchMethod · 0.95
updateDynamicStateMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected