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

Method unbind

packages/core/ui/core/bindable/index.ts:219–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

217 }
218
219 public unbind() {
220 const target = this.targetOptions.instance.get();
221 if (target instanceof Observable) {
222 if (this.options.twoWay) {
223 target.off(`${this.targetOptions.property}Change`, this.onTargetPropertyChanged, this);
224 }
225
226 if (this.sourceIsBindingContext && this.targetOptions.property !== 'bindingContext') {
227 target.off('bindingContextChange', this.bindingContextChanged, this);
228 }
229 }
230
231 if (this.targetOptions) {
232 this.targetOptions = undefined;
233 }
234
235 this.sourceProperties = undefined;
236 if (!this.source) {
237 return;
238 }
239
240 this.clearSource();
241 }
242
243 // Consider returning single {} instead of array for performance.
244 private resolveObjectsAndProperties(source: Object, properties: Array<string>): Array<{ instance: Object; property: string }> {

Callers 4

bindingContextChangedMethod · 0.95
bindFunction · 0.80
unbindFunction · 0.80
test_Bindable_UnbindFunction · 0.80

Calls 3

clearSourceMethod · 0.95
getMethod · 0.65
offMethod · 0.65

Tested by

no test coverage detected