I am trying to convert JavaScript functions to a dojo class. I have setTimeOut("functionName",2000)JS in one of my methods. As I call it from a method in the decared class using the dojo.declare method. For example, below is my custom class.
dojo.declare("Person",null,{
constructor:function(age,country,name,state){
this.age=age;
this.country=country;
this.name=name;
this.state=state;
},
moveToNewState:function(newState){
this.state=newState;
setTimeOut("isStateChanged",2000);
},
isStateChanged:function(){
alert('state is updated');
}
});
var person=new Person(12,"US","Test","TestState");
person.moveToNewState("NewState");
Please let me know how I can call a method isStateChangedfrom a method moveToNewStateafter 2000 ms.
source
share