- JavaScript library that converts functions to an extended functions.
- Allows preprocessor/postprocessor functions to be attached to a function in order to increase its abilities.
- Copyright: Copyright (c) 2006-2009 Andy Kant, http://andykant.com/
- Website: http://github.com/andykant/extended-function-factory
- License: MIT-style license
- Version: 0.3
var someFunction = function() { ... };
$xfn(someFunction);
var someClass = function() { ... };
someClass.prototype = { ... };
$xfn.extend(someClass.prototype);
someFunction.pre.add(function(result) {
// Do something.
arguments[0] = result + '';
// Always return the resulting arguments object to continue normally.
return arguments;
});
someFunction.post.add(function(result) {
// Process the arguments.
result = result * 10;
// Always return the resulting arguments object to continue normally.
return arguments;
});