can.proxy
Bind a function to its context.
can.proxy(fn, context)
Parameters
-
fn
{function()}
The function to bind to a context.
-
context
{Object}
The context to bind the function to.
Returns
{function()}
A function that calls fn in the context of context.
can.proxy(fn, context)
accepts a function and returns a new one that will always have the context from which it was called. This works similar to jQuery.proxy.