Being new to functional programming, I was working on my application's javascript (using jQuery exclusively), and wondering how jQuery's event system relates to it's functional programming paradigm.
I have a function setupAccountHeader that could easily be either a document-bound event like
$(document).bind('setupAccountHeader', function() {
blah, blah, blah;
});
OR
var setupAccountHeader = function() {
blah, blah, blah;
};
Then, either triggered or called when needed.
So I have two questions:
1) Which style is preferred for functional jQuery or is this purely a matter of taste/personal-style? What about implications for big-picture architecture?
2) Are there any good resources for functionally-styled jQuery? I feel like this is John Resig's intent, but I can't find much in the way of info or guides on what this means in implementation.