Skip to content

Instantly share code, notes, and snippets.

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

  • Save dkstevekwak/5ea48219fb8c72defe3acd74209e49f7 to your computer and use it in GitHub Desktop.

Select an option

Save dkstevekwak/5ea48219fb8c72defe3acd74209e49f7 to your computer and use it in GitHub Desktop.
/* Initialize CSInterface */
var csInterface = new CSInterface();
/* Nested callbacks (callback hell) */
csInterface.evalScript('firstFunction()', function(firstResult){
csInterface.evalScript(`secondFunction(${firstResult})`, function(secondResult){
csInterface.evalScript(`thirdFunction(${secondResult})`, function(thirdResult){
// more callbacks..!
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment