# cancel

function in `@dioramajs/diorama/core`

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

Returned from a hook handler to stop the chain. `callHook` then returns it.

```ts
function cancel(reason?: string): Cancel
```

| Parameter | Type | Description |
| --- | --- | --- |
| `reason?` | `string` |  |

Also exported from `@dioramajs/core`.

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