News for hackers. Stuff that matters.
Re:Why jQuery.proxy rocks my world by emehrkay on Wednesday April 27, 2011 @07:57AM (#2489146)
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.

There are no comments on this comment yet.