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

Method set

packages/core/data/observable/index.ts:126–136  ·  view source on GitHub ↗

* Updates the specified property with the provided value.

(name: string, value: any)

Source from the content-addressed store, hash-verified

124 * Updates the specified property with the provided value.
125 */
126 public set(name: string, value: any): void {
127 // TODO: Parameter validation
128 const oldValue = this[name];
129 if (this[name] === value) {
130 return;
131 }
132
133 const newValue = WrappedValue.unwrap(value);
134 this[name] = newValue;
135 this.notifyPropertyChange(name, newValue, oldValue);
136 }
137
138 /**
139 * Updates the specified property with the provided value and raises a property change event and a specific change event based on the property name.

Calls 2

notifyPropertyChangeMethod · 0.95
unwrapMethod · 0.80

Tested by 1

testFunction · 0.76