Remove runtime type checks from calling service

This commit is contained in:
Evan Hahn 2020-11-02 12:08:31 -06:00 committed by Evan Hahn
parent cfc3c123bc
commit b7a1ddf628

View file

@ -21,9 +21,6 @@ import {
UserId,
} from 'ringrtc';
// ts-ignore
import is from '@sindresorhus/is';
import {
ActionsType as UxActionsType,
CallDetailsType,
@ -61,26 +58,6 @@ export class CallingClass {
if (!uxActions) {
throw new Error('CallingClass.initialize: Invalid uxActions.');
}
if (!is.function_(uxActions.incomingCall)) {
throw new Error(
'CallingClass.initialize: Invalid uxActions.incomingCall'
);
}
if (!is.function_(uxActions.outgoingCall)) {
throw new Error(
'CallingClass.initialize: Invalid uxActions.outgoingCall'
);
}
if (!is.function_(uxActions.callStateChange)) {
throw new Error(
'CallingClass.initialize: Invalid uxActions.callStateChange'
);
}
if (!is.function_(uxActions.remoteVideoChange)) {
throw new Error(
'CallingClass.initialize: Invalid uxActions.remoteVideoChange'
);
}
RingRTC.handleOutgoingSignaling = this.handleOutgoingSignaling.bind(this);
RingRTC.handleIncomingCall = this.handleIncomingCall.bind(this);
RingRTC.handleAutoEndedIncomingCallRequest = this.handleAutoEndedIncomingCallRequest.bind(