by seliopou · 15y ago · 0 comments
whenever("Click Me!").is('clicked').then('change it to "clicked"')
turns into: var cbs = {};
cbs.setClickedText = function() { $(this).text('Clicked!'); };
$('a#click-me').click(cbs.setClickedText);In eyeballs.js, for examples, I explored doing all of the binding via the html elements themselves, eg:
<a href="#" data-bind="posts#new">New Post</a>
which would map to a pre-defined posts controller new action.
whenever.js is just another exploration along the same theme. Again, I'm not arguing that it's better or worse: just my motivations for making it.