4 ms·
That looks like a Class in MooTools. Difference seems to be that it is a single lib dependency and "proxy" is called "bind" It would look something like this
by emehrkay 16y ago
That looks like a Class in MooTools. Difference seems to be that it is a single lib dependency and "proxy" is called "bind"
It would look something like this
var FBNotificationWatcher = new Class({
Implements: [Options],
options: {
timeout: 500,
url: 'http://dot.com',
onRequestComplete: function(response){}
},
initialize: function(options){
this.setOptions(options);
this.request = new Request({
url: this.options.url,
onComplete: function(resp){
this.processNotifications(resp);
this.options.onRequestComplete(resp);
}.bind(this)
});
this.getNotifications();
},
getNotifications: function(){
this.request.send({//data});
return this;
},
processNotifications: function(rawNotificationData){
//do stuff
this.getNotifications.delay(this.options.timeout, this);
}
});
I'll check out backbone if I'm doing some jQuery dev.