Skip to content

Instantly share code, notes, and snippets.

View voltidev's full-sized avatar

Ivan Volti voltidev

View GitHub Profile
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');
@voltidev
voltidev / coffee-tip.md
Created February 20, 2013 08:06
Small coffee-script aliases for setTimeout and setInterval
after = (ms, cb) -> setTimeout cb, ms
every = (ms, cb) -> setInterval cb, ms

Now we can say:

after 500, -> # do something...

Instead of:

setTimeout ->