after = (ms, cb) -> setTimeout cb, ms
every = (ms, cb) -> setInterval cb, ms
Now we can say:
after 500, -> # do something...
Instead of:
setTimeout ->
import Ember from 'ember'; | |
var Pollster = Ember.Object.extend({ | |
// Time between polls (in milliseconds). | |
interval: 5000, | |
// Schedules the function `func` to be executed every `interval` time. | |
schedule: function(func) { | |
var interval = this.get('interval'); | |
var isPolling = this.get('isPolling'); |
after = (ms, cb) -> setTimeout cb, ms
every = (ms, cb) -> setInterval cb, ms
Now we can say:
after 500, -> # do something...
Instead of:
setTimeout ->