Last active
January 11, 2020 15:34
-
-
Save anshuman-singh-93/78f5c71a066fde6a94851a0b6a5fc192 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const promisifyIt = (fn) => (...args)=>{ | |
return new Promise((resolve,reject)=>{ | |
fn(...args,(err,data)=>{ | |
if(err){ | |
reject(err) | |
} | |
else{ | |
resolve(data) | |
} | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment