Skip to content

Instantly share code, notes, and snippets.

@ORESoftware ORESoftware/promises.ts
Last active Mar 11, 2019

Embed
What would you like to do?
promise api technique
export class Worker {
getLock(v: string, cb: Function){
this.getLockInternal(v,cb);
}
getLockp(v:string){
return new Promise((resolve,reject) => {
this.getLockInternal(v, (err,result) => {
err ? reject(err) : resolve(result);
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.