import {
HMSReactiveStore,
selectIsConnectedToRoom,
} from "@100mslive/hms-video-store";
const hms = new HMSReactiveStore();
const hmsStore = hms.getStore();
const hmsActions = hms.getActions();
hmsActions.join({
userName: "streamer",
authToken: "<app-token>"
});
hmsStore.subscribe(isConnected => {
if (isConnected)
hmsActions.startHLSStreaming();
}, selectIsConnectedToRoom);