Skip to content

Instantly share code, notes, and snippets.

@MStumpp
MStumpp / chain.js
Created October 3, 2012 23:28
chain.js - add function chaining capability
function chainify(clazz) {
var Chain = function() {};
Chain.prototype.exec = function() {
return this.c_process();
};
Chain.prototype.c_chain = function(func, args) {
if (!func)
throw new Error('Provide a function to be chained.');