Guest User

Untitled

a guest
Feb 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. fadeOutBox();
  2. fadeInInfoBlock();
  3.  
  4. async function runInOrder(){
  5. await fadeOutBox();
  6. await fadeInInfoBlock();
  7. }
  8.  
  9. function fadeOutBox() {
  10. // do stuff
  11. fadeInInfoBlock()
  12. }
  13.  
  14. fadeOutBox()
  15.  
  16. function fadeOutBox(){
  17. return new Promise(function(resolve, reject) {
  18. //True statement
  19. resolve('true')
  20. });
  21. }
  22.  
  23. fadeOutBox.then(function(value) {
  24. console.log(value);
  25. fadeInInfoBlock();
  26. })
  27.  
  28. async function syncFn(){
  29. await fadeOutBox();
  30. await fadeInInfoBlock();
  31. }
Add Comment
Please, Sign In to add comment