# computed

function in `@dioramajs/diorama/core`

```ts
import { computed } from '@dioramajs/diorama/core'
```

A read-only value derived from signals, recomputed lazily when they change.

```ts
function computed<T>(
  compute: () => T,
  options?: SignalOptions<T>,
): ReadonlySignal<T>
```

| Parameter | Type | Description |
| --- | --- | --- |
| `compute` | `() => T` |  |
| `options?` | `SignalOptions<T>` |  |

Throws `SIGNAL_CYCLE` on read when the value depends on itself.

Also exported from `@dioramajs/core`.

Defined in [packages/core/src/kernel/signals.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/core/src/kernel/signals.ts#L362).
