SimpleInvoke
Chained invocation of functions with callbacks.
Installation
Via npm on Node:
npm install simpleinvoke
Usage
Reference in your program:
var si = ;
You can chain two functions with callbacks, specifying the function and an array with its arguments.
// function with callback(err, result) { ; } si;
The argument list can be omitted (if it is not the last function).
If you specify a function as the last argument, it will be the final callback, receiving any not consumed error, and the accumulated results:
si;
You can consume the previous result in the next invocation:
si;
Detected exceptions are trapped by final callback:
si;
If a callback informs an error, it is trapped by final callback, cancelling the chain process:
si;
An error in an invocation can be consumed by the next function to invoke:
si;
You can invoke object methods:
var obj = { ; }; si;
TBD
Development
git clone git://github.com/ajlopez/SimpleInvoke.git
cd SimpleInvoke
npm install
npm test
Samples
TBD
To do
- Samples
Versions
- 0.0.1: Published.
Inception
The syntax and idea was inspired by azure-scripty by Glenn Block.
Contribution
Feel free to file issues and submit pull requests � contributions are welcome.
If you submit a pull request, please be sure to add or update corresponding
test cases, and ensure that npm test
continues to pass.