> ## Documentation Index
> Fetch the complete documentation index at: https://krono.fabianpiper.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OnStatusUpdate

> Subscribe to connection state changes.

## Import

```ts theme={null}
import { Orderbook } from '@krono/core'
```

## Usage

Use this to react to connection changes, such as showing a loading spinner during `connecting` or an error banner.

```ts theme={null}
orderbook.onStatusUpdate((status) => {
  console.log(`Current status: ${status}`)
})
```

## Parameters

### callback

`(status: ConnectionStatus) => void`

Receives `'disconnected' | 'connecting' | 'connected' | 'error'`.

## Return Type

```ts theme={null}
void
```
