mardi 3 février 2015

what is the Ember implementation of setInterval and clearInterval

Ember has the following implementation of setTimeout, which it is recommended developers use because the code gets added to the run loop, which has advantages for tests.



Ember.run.later((function() {
console.log("will run once after 1000");
}), 1000);


Is there a similar Ember replacement for setInterval and, by implication, clearInterval (which is used to cancel a setInterval)? I need to run someFunc every 1000 ms



this.intervalId = setInterval(this.someFunc.bind(this), 1000);

Aucun commentaire:

Enregistrer un commentaire