Skip to content

lucasad/chain.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chain.js

A utility for chaining together functions. It was inspired by connect.

Usage

var Chain = require('chain');
var func1 = function(a,b,next) {
  console.log("In func1, a is", a, "and b is", b);
  return next(a++,++b);
}
var func2 = function(a,b) {
  console.log("In func2, a is", a, "and b is", b);
  return "YAY";
}

var chained = new Chain(func1);
chained.use(func2);
console.log(chained(5,12));

About

Break your shackles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published