async-executor
v0.0.2
Published
Async method executor
Downloads
2
Readme
#How to install
node install async-executor
#How to initialize
var Executor = require('async-executor');
function MyClass(){
}
MyClass.prototype.doSomething=function(){
var executor=new Executor();
executor.result(null, {success: true}); // call if success
//executor.result({error: true}, null); // call if error
return executor;
};
#How to use
var obj=new MyClass();
obj.doSomething().success(function(data){}).error(function(error){});