Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initRemoteApiWithUrl = async (remoteStreamUrl): Promise => {
Logger.debug(`initRemoteApiWithUrl start`);
// eslint-disable-next-line
Logger.debug(`initRemoteApiWithUrl remoteStreamUrl: ${remoteStreamUrl}`);
this.apiRemote = new Api({
provider: remoteStreamUrl,
// types,
});
this.apiRemote.on('connected', () => {
Logger.debug(`initRemoteApiWithUrl apiRemote connected`);
this.dispatch({
type: actionTypes.wsRemoteStatusChange.triggered,
payload: {
type: 'connected',
},
});
});
this.apiRemote.on('ready', () => {
Logger.debug(`initRemoteApiWithUrl ready`);
this.dispatch({
type: actionTypes.wsRemoteStatusChange.triggered,
initApi = async (): Promise => {
Logger.debug(`initApi start`);
Logger.debug(`initApi streamUrl: ${appConfig.webSocket.localStreamUrl}`);
this.api = new Api({
provider: appConfig.webSocket.localStreamUrl,
});
this.api.on('connected', () => {
Logger.debug(`initApi connected`);
this.dispatch({
type: actionTypes.wsLocalStatusChange.triggered,
payload: {
type: 'connected',
},
});
});
this.api.on('ready', async () => {
Logger.debug(`initApi ready`);
this.dispatch({
type: actionTypes.wsLocalStatusChange.triggered,
payload: {