Module ringo/functional
Functions
- bindArguments(fn, args)
- bindThisObject(fn, obj)
bindArguments (fn, args)
Return a function wrapper around another function that binds some or all arguments of the original function. The argument list of the returned function corresponds to the arguments of the original function that are not covered by the pre-defined arguments.
This is a simple reimplementation of Mochikit partial()
Parameters
| fn | {function} a function | |
| args |
Returns
| function | a function with bound arguments |
bindThisObject (fn, obj)
Create a wrapper for a function that always binds an object to the this-object even if it is called as global function or on another this-object.
Parameters
| fn | {function} a function | |
| obj | {Object} the object to bind to the "this" object |
Returns
| a function with bound this object |
