Guest User

Untitled

a guest
Mar 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. function notMyFunction(a, cb) {
  2. if (a === 'latest') {
  3. cb(null, '123');
  4. } else {
  5. cb('error', null);
  6. }
  7. }
  8. function deploy(someVariable) {
  9. return new Promise((resolve, reject) => {
  10. notMyFunction(someVariable, resolve);
  11. });
  12. }
  13. deploy('latest').then((time) => {
  14. // I need access to 123, not null
  15. console.log(time)
  16. }, (err) => {
  17. console.log(err)
  18. })
Add Comment
Please, Sign In to add comment