Skip to content

stateBridge<State>(key): StateBridge<State>

Defined in: packages/wire/src/state-bridge.ts:59

Create the StateBridge for one package, keyed by the string in its Symbol.for key.

A package owns exactly one bridge. Its key is part of no wire format: it identifies the attached state within a realm, and nothing persists it.

State

string

A knotkit/<module>/<name>@<version> key. The version suffix allows a later release to move its state shape without reading state attached by an older copy loaded beside it.

StateBridge<State>

With INVALID_ARGUMENT when key does not match that shape.