Twitter Flight

JS ZOO

+

Component

Advice

Regstry

Аrchitecture

[ UI ]

[ Data ]

Events

Handling

this.after("initialize", function() {
this.on("uiItemsRequested", this.serveMailItems);
this.on("dataItemsRefreshRequested", this.serveMailItems);
});

Triggering

this.forwardMail = function(ev, data) {
this.trigger('uiForwardMail');
};

Features

Why events?

Creating component

function attachTo(selector/*, options args */) {
    if (!selector) {
        throw new Error();
    }

    $(selector).each(function(i, node) {
        new this(node, options);
    }.bind(this));
}

Problems

Components collection

No framework is perfect,
but we're getting there

Thanks!

http://sabov.github.com/flight.js-overview @alexsabov