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

[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

[IWatchedValueReadonly](https://docs.lumencharts.com/charting-library/api/IWatchedValueReadonly), [IObservableValue](https://docs.lumencharts.com/charting-library/api/IObservableValue)

## setValue {#setvalue}

```ts
setValue(value: T, forceUpdate?: boolean): void;
```

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

| Parameter | Type | Required |
| --- | --- | --- |
| `value` | `T` | Yes |
| `forceUpdate` | `boolean` | No |

## subscribe {#subscribe}

```ts
subscribe(
    callback: WatchedValueCallback<T>,
    options?: WatchedValueSubscribeOptions,
  ): void;
```

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

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

## unsubscribe {#unsubscribe}

```ts
unsubscribe(callback?: WatchedValueCallback<T> | null): void;
```

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

| Parameter | Type | Required |
| --- | --- | --- |
| `callback` | `WatchedValueCallback<T> &#124; null` | No |

## Related types

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

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