@azure/communication-react
Version:
React library for building modern communication user experiences utilizing Azure Communication Services
31 lines • 1.1 kB
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ProxyCallCommon } from './CallDeclarativeCommon';
class ProxyTeamsCall extends ProxyCallCommon {
get(target, prop) {
switch (prop) {
default:
return super.get(target, prop);
}
return super.get(target, prop);
}
}
/**
* Creates a declarative Call by proxying Call with ProxyCall.
* This should only be used with CallAgentDeclarative as CallAgentDeclarative will add that
* call to the context properly (need to have the Call in context to update it - CallAgentDeclarative will add Call to
* context)
*
* @param call - TeamsCall from SDK
* @param context - CallContext from StatefulCallClient
*/
export const teamsCallDeclaratify = (call, context) => {
const proxyCall = new ProxyTeamsCall(context);
proxyCall.unsubscribe();
Object.defineProperty(call, 'unsubscribe', {
configurable: false,
value: () => proxyCall.unsubscribe()
});
return new Proxy(call, proxyCall);
};
//# sourceMappingURL=TeamsCallDeclarative.js.map