Skip to content
Classcorev0.10.0

DispatchContext

A typed bag allocated once per interaction dispatch and handed to the handler. The middleware and i18n work reads and writes it through DispatchState. Today the bag is empty, so it only carries the dispatched routeId.

class DispatchContext implements DispatchBag

Member visibility

Filter class members by access level.

constructor

Constructs a new instance of the DispatchContext class

DispatchContext(routeId: string)

Showing members with Protected visibility and higher.

routeId

public readonly routeId: string

require()

Read a key that must be present, with undefined stripped from the result.

public require<Key>(
    key: Key
): Exclude<DispatchState[Key], undefined>

Throws:

A SeedcordError If nothing set the key on this dispatch.