HMSReactiveStore<T>

Type parameters

NameType
Textends HMSGenericTypes = { sessionStore: Record<string, any> }

Constructors

constructor

new HMSReactiveStore<T>(hmsStore?, hmsActions?, hmsNotifications?)

Type parameters

NameType
Textends HMSGenericTypes = { sessionStore: Record<string, any> }

Parameters

NameType
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>


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

HMSNotifications


getStats

getStats(): HMSStatsStoreWrapper

Returns

HMSStatsStoreWrapper


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


Have a suggestion? Recommend changes ->

Was this helpful?

1234