Experience: Newbie
I have initialize function like this
initialize: function(){
this.listenTo(this.model, "change", this.asyncRender);
}
I want to listen to changes periodically,like for every 5 sec
I want something like this
setTimeout(function(){
this.listenTo(this.model, "change", this.asyncRender);
}, 5000);
How to do this?
Update:
This is throwing error updateValues not defined
initialize: function(){
this.listenTo(this.model, "change", this.asyncRender);
setInterval(function(){
this.listenTo(this.model, "change", this.updateValues);
console.log("3 seconds");
},3000)
},
this is not throwing errors
initialize: function(){
this.listenTo(this.model, "change", this.asyncRender);
this.listenTo(this.model, "change", this.updateValues);
},