Function: injectSharedState()
@roomful/angular / injectSharedState
Function: injectSharedState()
Section titled “Function: injectSharedState()”injectSharedState<
T,TPresence>(key,options): readonly [Signal<T>,SharedStateSetter<T>]
Defined in: angular/src/index.ts:1509
Binds a shared state value to Angular signal semantics.
Must be called in an injection context. Enforces a single shared-state
binding per room: a second injectSharedState for the same room must use the
same key and compatible options.
Type Parameters
Section titled “Type Parameters”T
The shared state value type.
TPresence
Section titled “TPresence”TPresence extends PresenceData = PresenceData
The room presence shape.
Parameters
Section titled “Parameters”string
The logical binding key used to enforce a single shared-state binding per room.
options
Section titled “options”StateOptions<T>
The shared-state configuration.
Returns
Section titled “Returns”readonly [Signal<T>, SharedStateSetter<T>]
The current shared state signal and a React-style setter.