Merge 31dc29ab37b32564a12e47b4ce23aa363cea15dd into 3ecfb4e898076ff3cd4d83001be2721065c43acf
This commit is contained in:
commit
15ab6c031b
@ -364,20 +364,26 @@ export class AbstractType {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Observe all events that are created on this type.
|
* Observe all events that are created on this type.
|
||||||
|
* Returns a function to stop sending events to the provided callback once called
|
||||||
*
|
*
|
||||||
* @param {function(EventType, Transaction):void} f Observer function
|
* @param {function(EventType, Transaction):void} f Observer function
|
||||||
|
* @returns {function():void}
|
||||||
*/
|
*/
|
||||||
observe (f) {
|
observe (f) {
|
||||||
addEventHandlerListener(this._eH, f)
|
addEventHandlerListener(this._eH, f)
|
||||||
|
return () => this.unobserve(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Observe all events that are created by this type and its children.
|
* Observe all events that are created by this type and its children.
|
||||||
|
* Returns a function to stop sending events to the provided callback once called
|
||||||
*
|
*
|
||||||
* @param {function(Array<YEvent<any>>,Transaction):void} f Observer function
|
* @param {function(Array<YEvent<any>>,Transaction):void} f Observer function
|
||||||
|
* @returns {function():void}
|
||||||
*/
|
*/
|
||||||
observeDeep (f) {
|
observeDeep (f) {
|
||||||
addEventHandlerListener(this._dEH, f)
|
addEventHandlerListener(this._dEH, f)
|
||||||
|
return () => this.unobserveDeep(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user