Skip to content

Instantly share code, notes, and snippets.

@calvinmetcalf
Created August 21, 2013 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calvinmetcalf/6292694 to your computer and use it in GitHub Desktop.
Save calvinmetcalf/6292694 to your computer and use it in GitHub Desktop.
function addPromise(a,b){
var def = deferred();
asyncAdd(a,b,function(err,success){\
if(err){
def.reject(e);
}else{
def.resolve(e);
}
});
return def.promise
}
addPromise(2,3).then(function(data){
console.log(data);
},function(err){
console.log('oh noes!');
});
@khanejaz
Copy link

hy i am new waht is a program

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment