# batch

function in `@dioramajs/diorama/core`

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

Runs `fn` and notifies effects once at the end, not after each write.

```ts
function batch<T>(fn: () => T): T
```

| Parameter | Type | Description |
| --- | --- | --- |
| `fn` | `() => T` |  |

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#L379).
