grnadav / databind

Two way data binding, dependant on nothing, not opinionated
Other
97 stars 17 forks source link

Differentiated syntax #2

Open m1sta opened 11 years ago

m1sta commented 11 years ago

Love what you've done so far.

Given the number of similar projects out there are the moment though, it would be interesting if you could consider taking this down a different path from a syntax perspective.

I've be playing with the idea of data binding library that looks like this...

        var bandItem = bindi.find(".bandItem").mapTo(bands);
        var bandItemsEmpty = bindi.find(".noBands").mapTo(bands, ifEmpty);
        var memberItem = bindi.find(".memberItem").mapTo(bandItem.members);
        var memberItemsEmpty = bindi.find(".noMembers").mapTo(bandItem.members, ifEmpty);

Making it easy to learn and easy to read are the key goals for me (I think this is the major shortcoming of the popular frameworks like angular). The approach I'm going for keeps all the model definition and binding logic together and creates a situation where the removal of the binding script leaves the UI looking like a healthy template. This last factor is useful in recognition of the workflow usually taken on web projects - mockup the UI, then bind some data to it.

This is as far as I've got so far... https://gist.github.com/m1sta/5843286