# Function whenOnce

- whenOnce<TObsv, TPath>(obj, path, options?): Promise<void>

- Watches the given path on the given object for the first change that causes the value of the watched property to be truthy.

  See support/observableUtils!watch for more details.

  #### Type Parameters

  - TObsv extends Observable
  - TPath extends string

  #### Parameters

  - obj: TObsv

    The object to watch.

  - path: TPath

    The property path to watch.

  - `Optional` options: Pick<WhenOptions, "invert"> & {
    signal?: AbortSignal;
    }

    Optional. The options to use for watching the property.

  #### Returns Promise<void>

  #### Throws

  Error if the object is not observable.

  #### Throws

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