Skip to content

Instantly share code, notes, and snippets.

@xcambar
Created September 27, 2012 09:43
Show Gist options
  • Save xcambar/3793168 to your computer and use it in GitHub Desktop.
Save xcambar/3793168 to your computer and use it in GitHub Desktop.
basic Harmony module
Module dynamicList {
import xhr from '/dataSources.js'; // dataSources is another module
import template at '/tpls/list.js';
var classNames = ['dynamic', 'vertical'];
var refreshInterval = 300000; //ms
var run = function (rootElt, params) {
return setInterval(function () {
xhr.get('/list', params, function (data) {
template.compile(data, rootElt, {classes: classNames});
});
}, refreshInterval);
}
export run;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment