HMSReactiveStore<T>
Type parameters
Name | Type |
---|---|
T | extends HMSGenericTypes = { sessionStore : Record <string , any > } |
Constructors
constructor
• new HMSReactiveStore<T
>(hmsStore?
, hmsActions?
, hmsNotifications?
)
Type parameters
Name | Type |
---|---|
T | extends HMSGenericTypes = { sessionStore : Record <string , any > } |
Parameters
Name | Type |
---|---|
hmsStore? | IHMSStore <T > |
hmsActions? | HMSActions <T > |
hmsNotifications? | HMSNotifications <T > |
Methods
getActions
▸ getActions(): HMSActions
<T
>
Any action which may modify the store or may need to talk to the SDK will happen through the IHMSActions instance returned by this
Returns
HMSActions
<T
>
getDiagnosticsSDK
▸ getDiagnosticsSDK(): HMSDiagnosticsInterface
Returns
getHMSActions
▸ getHMSActions(): HMSActions
<T
>
Any action which may modify the store or may need to talk to the SDK will happen through the IHMSActions instance returned by this
Returns
HMSActions
<T
>
Deprecated
use getActions
getNotifications
▸ getNotifications(): HMSNotifications
This return notification handler function to which you can pass your callback to receive notifications like peer joined, peer left, etc. to show in your UI or use for analytics
Returns
getStats
▸ getStats(): HMSStatsStoreWrapper
Returns
getStore
▸ getStore(): HMSStoreWrapper
<{ sessionStore
: Record
<string
, any
> }>
A reactive store which has a subscribe method you can use in combination with selectors to subscribe to a subset of the store. The store serves as a single source of truth for all data related to the corresponding HMS Room.
Returns
HMSStoreWrapper
<{ sessionStore
: Record
<string
, any
> }>
triggerOnSubscribe
▸ triggerOnSubscribe(): void
By default, store.subscribe does not call the handler with the current state at time of subscription, this behaviour can be modified by calling this function. What it means is that instead of calling the handler only for changes which happen post subscription we'll also call it exactly once at the time of subscription with the current state. This behaviour is similar to that of BehaviourSubject in RxJS. This will be an irreversible change
Note: you don't need this if you're using our React hooks, it takes care of this requirement.
Returns
void