You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parameters class and arrayOfMethodNames specify methods to generate in the proxy class.
Parameter fieldName specifies a name of a field where the instance with a real implementation is stored.
varPhoneProxy=defineClass.proxy(Phone);varphone=newPhone(1000,"120-1010");varproxy=newPersonProxy(phone);proxy.dial("120-0000");// Output: Dialing to 120-0000
Inheriting from a proxy
Defining a class inherited from a proxy class is easy as
varPhoneWrapper=defineClass({_super: defineClass.proxy(Phone),dial: function(number){this._super(number);console.log("too too");}});varphone=newPhone(1000,"120-1010");varproxy=newPhoneWrapper(phone);proxy.dial("120-0000");// Output: Dialing to 120-0000\ntoo too