<!-- Public documentation export; not library implementation source. -->
# IWatchedValueReadonly

[Integration guide](https://docs.lumencharts.com/charting-library/reference/compatibility) · [Reference index](https://docs.lumencharts.com/charting-library/api/)

Public contract reference. This declaration describes types and callback shapes; availability is constrained by the linked integration guide and the runtime capability. Legacy product-specific fields are not a promise of implementation.

## Extends

[IObservableValueReadOnly](https://docs.lumencharts.com/charting-library/api/IObservableValueReadOnly)

## subscribe {#subscribe}

```ts
subscribe(
    callback: (value: T) => void,
    options?: WatchedValueSubscribeOptions,
  ): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `callback` | `(value: T) => void` | Yes |
| `options` | `WatchedValueSubscribeOptions` | No |

## unsubscribe {#unsubscribe}

```ts
unsubscribe(callback?: ((value: T) => void) | null): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `callback` | `((value: T) => void) &#124; null` | No |

## when {#when}

```ts
when(callback: WatchedValueCallback<T>): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `callback` | `WatchedValueCallback<T>` | Yes |

## Related types

- [IObservableValueReadOnly](https://docs.lumencharts.com/charting-library/api/IObservableValueReadOnly)
- [WatchedValueSubscribeOptions](https://docs.lumencharts.com/charting-library/api/WatchedValueSubscribeOptions)
- [WatchedValueCallback](https://docs.lumencharts.com/charting-library/api/WatchedValueCallback)

---
Documentation page: https://docs.lumencharts.com/charting-library/api/IWatchedValueReadonly
