Skip to content

Function: useSharedState()

@roomful/solid


@roomful/solid / useSharedState

useSharedState<T, TPresence>(key, options): readonly [Accessor<T>, SharedStateSetter<T>]

Defined in: solid/src/index.ts:1626

Binds a shared state value to Solid signal semantics.

T

The shared state value type.

TPresence extends PresenceData = PresenceData

The room presence shape.

string

The logical binding key used to enforce a single shared-state binding per room.

StateOptions<T>

The shared-state configuration.

readonly [Accessor<T>, SharedStateSetter<T>]

The current shared state accessor and a React-style setter.