• Watches the given path on the given object for changes and automatically adds and removes the given event listener.

    Type Parameters

    • TObsv extends Observable
    • TPath extends string
    • TTarget
    • TEventName extends string

    Parameters

    • obj: TObsv

      The object to watch.

    • path: TPath

      The property path to an Evented object on the given object to watch.

    • event: [TEventName, EventedCallback<EventTypes<EventTarget<TTarget>>[TEventName]>]

      The event and the listener to add to the Evented object.

    • OptionalwatchCallback: ((newTarget: TTarget, oldTarget: TTarget) => void)

      The callback to invoke when the watched property changes. This is optional and will be invoked with the Evented object being watched.

        • (newTarget, oldTarget): void
        • Parameters

          Returns void

    Returns IHandle

    Error if the object is not observable.

    Error if the path is to a non-configurable property on an observable.