ObservableObject.whence()
Returns the containing (attached) observable object of this type, for the provided object.
static whence<T extends ObservableObject>(
this: new (...args: any[]) => T,
object?: ObservableObject,
): T | undefined;
Summary
This method finds and returns the closest containing object, i.e. parent, or parent’s parent, etc., which is an instance of the specific class on which this method is called. For example, calling ObservableObject.whence(obj) results in the first parent object, if any; however calling SomeClass.whence(obj) results in the one of the parents (if any) that’s actually an instance of SomeClass.
Parameters
- object — The object for which to find the containing object
Return value
The closest containing (attached) object, which is an instance of the class on which this method is called.
Related
class ObservableObject
The base class of all observable objects, which can be placed into a tree structure to enable event handling and data binding.
