MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / _observe

Function _observe

packages/core/ui/core/view/view-common.ts:301–314  ·  view source on GitHub ↗
(type: GestureTypes, callback: (args: GestureEventData) => void, thisArg?: any)

Source from the content-addressed store, hash-verified

299 }
300
301 protected _observe(type: GestureTypes, callback: (args: GestureEventData) => void, thisArg?: any): void {
302 thisArg = thisArg || undefined;
303
304 if (this._gestureObservers[type]?.find((observer) => observer.callback === callback && observer.context === thisArg)) {
305 // Already added.
306 return;
307 }
308
309 if (!this._gestureObservers[type]) {
310 this._gestureObservers[type] = [];
311 }
312
313 this._gestureObservers[type].push(gestureObserve(this, type, callback, thisArg));
314 }
315
316 public getGestureObservers(type: GestureTypes): Array<GesturesObserver> | undefined {
317 return this._gestureObservers[type];

Callers

nothing calls this directly

Calls 2

findMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected