async-executor

0.0.2 • Public • Published

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){});

Readme

Keywords

Package Sidebar

Install

npm i async-executor

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • maxazan