vigetlabs / washi

A simple, backbone inspired view helper.
http://vigetlabs.github.io/washi/docs/washi
MIT License
5 stars 2 forks source link

Jqueryless #11

Closed nhunzaker closed 9 years ago

nhunzaker commented 9 years ago

Woo! I think it's close! Let me know what you think!

There are a couple of new things:

This version does not use jQuery, and clocks in around 1.6kb. With more advanced optimizations, you could probably get it lower, but I'm not sweating it.

Washi is now a factory, you provide it an object and it imbues Washi's behavior into it. This means you should be able to use whatever method you want for inheritance, no more reliance on new or .extend

Washi's core library for doing all of this has been implemented as a chainable API that should feel like a mixture of Underscore and jQuery. Of course, it is extendable.

Couple of examples:

Washi.$([1,2,3,4,5]).join(' ') // => '1 2 3 4 5'
Washi.$('number').query().result('value', 10) // => If defined, value, otherwise 10

// And of course, the default behavior
Washi({
    el: 'selector',

    ui: {
        links: 'a'
    },

    events: {
        'click { links }': 'doSomething'
    },

    doSomething: function() {}
})
jeremyfrank commented 9 years ago

:+1: