Skip to content

Instantly share code, notes, and snippets.

@dkstevekwak
Created March 7, 2018 16:19
Show Gist options
  • Select an option

  • Save dkstevekwak/053bab32411aaa0b94f2699e1ae17813 to your computer and use it in GitHub Desktop.

Select an option

Save dkstevekwak/053bab32411aaa0b94f2699e1ae17813 to your computer and use it in GitHub Desktop.
/* Promisified functions */
runEvalScript('firstFunction()')
.then(function(firstResult){
return runEvalScript(`secondFunction(${firstResult})`)
})
.then(function(secondResult){
return runEvalScript(`thirdFunction(${secondResult})`)
})
.then(function(thirdResult){
// more promises..!
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment