Reputation: 15
I am rewriting(code refactoring) the Javascript code into Typescript. I face a problem when converting reveal module Pattern into typescript namespace. The only thing that I don't understand is the role of global here. I really don't know what this global means here.
//My Javascript Code
var TPS = (function(global)
{
var met = {
supported: TPSSupported,
isCalledDNMatchesTPS: isCalledDNMatchesTPS,
isTPSReady: isTPSReady,
isActiveCall: isActiveCall
}
return met;
})(this);
//My solution
namespace TPS {
export let met = {
supported: TPSSupported,
isCalledDNMatchesTPS: isCalledDNMatchesTPS,
isTPSReady: isTPSReady,
isActiveCall: isActiveCall
}
}
Upvotes: 1
Views: 57