// The old instantiable API could be maintained like this:
var exports = module.exports = function FastClick(el) {
exports.attach(el);
};
exports.attach = function(el) {
// Add event listeners
}
/* The rest of the workings of FastClick could be made completely private */
Would this be worthwhile doing or am I missing something fundamental here?
I feel this module could be a lot simpler (and potentially compress down a bit smaller) if it were written using the simple module pattern.
This would also allow us to make all but the
attach
method (and the previousnew FastClick
API) completely private (and therefore extra compressable).We would also be able to remove these lines:-
Something like this:-
Would this be worthwhile doing or am I missing something fundamental here?