# DispatchContext

`class` in `core` · v0.1.0-next.5

<https://docs.seedcord.org/packages/core/0.1.0-next.5/classes/dispatch-context>

A typed bag allocated once per interaction dispatch and handed to the handler. The middleware and i18n work reads and writes it through [`DispatchState`](/packages/core/0.1.0-next.5/interfaces/dispatch-state). Today the bag is empty, so it only carries the dispatched `routeId`.

```ts
class DispatchContext
```

## Constructors

### constructor

```ts
DispatchContext(routeId: string | null)
```

Constructs a new instance of the `DispatchContext` class

## Properties

### routeId

```ts
public readonly routeId: string | null
```

## Methods

### get

```ts
public get<Key>(key: Key): DispatchState[Key] | undefined
```

### set

```ts
public set<Key>(key: Key, value: DispatchState[Key]): void
```
