Skip to content

Instantly share code, notes, and snippets.

@STRd6
Created May 16, 2014 04:43
Show Gist options
  • Save STRd6/3c96054cd20584460ff0 to your computer and use it in GitHub Desktop.
Save STRd6/3c96054cd20584460ff0 to your computer and use it in GitHub Desktop.
Lollable
var Callable, c,
__slice = [].slice;
Callable = function(invoke) {
var fn;
fn = function() {
var _ref;
return (_ref = fn.invoke).call.apply(_ref, [this].concat(__slice.call(arguments)));
};
fn.invoke = invoke;
return fn;
};
c = Callable(function() {
return alert("hello");
});
c();
c.invoke = function() {
return alert("goodbye");
};
c();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment