mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 22:01:42 +08:00
chore: removed this for now. Not really needed as using plugin
This commit is contained in:
11
packages/core/data/observable/index.d.ts
vendored
11
packages/core/data/observable/index.d.ts
vendored
@ -164,17 +164,6 @@ export class Observable {
|
||||
public _isViewBase: boolean;
|
||||
//@endprivate
|
||||
|
||||
/**
|
||||
* This method is intended to be overriden by inheritors to be notified when a new listener is added
|
||||
* count is the number of listeners for that event after addition
|
||||
*/
|
||||
onListenerAdded(eventName: string, count: number);
|
||||
|
||||
/**
|
||||
* This method is intended to be overriden by inheritors to be notified when a new listener is removed
|
||||
* count is the number of listeners for that event after removal
|
||||
*/
|
||||
onListenerRemoved(eventName: string, count: number);
|
||||
|
||||
}
|
||||
|
||||
|
@ -95,8 +95,6 @@ export class Observable implements ObservableDefinition {
|
||||
public off(eventNames: string, callback?: any, thisArg?: any): void {
|
||||
this.removeEventListener(eventNames, callback, thisArg);
|
||||
}
|
||||
onListenerAdded(eventName: string, count: number) {}
|
||||
onListenerRemoved(eventName: string, count: number) {}
|
||||
|
||||
public addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void {
|
||||
if (typeof eventNames !== 'string') {
|
||||
@ -116,7 +114,6 @@ export class Observable implements ObservableDefinition {
|
||||
callback: callback,
|
||||
thisArg: thisArg,
|
||||
});
|
||||
this.onListenerAdded(event, list.length );
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,11 +140,9 @@ export class Observable implements ObservableDefinition {
|
||||
delete this._observers[event];
|
||||
}
|
||||
}
|
||||
this.onListenerRemoved(event, list ? list.length : 0);
|
||||
} else {
|
||||
this._observers[event] = undefined;
|
||||
delete this._observers[event];
|
||||
this.onListenerRemoved(event, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user