Advertisement
xDisfigure

Untitled

Apr 30th, 2019
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .then((result) => {
  2.     if(pause) {
  3.         return new Promise( () => {
  4.             let id = setInterval(() => {
  5.                 if(!pause) {
  6.                     resolve(result);
  7.                     clearInterval(id);
  8.                 }
  9.             }, 100);
  10.         });
  11.     }
  12.     return result;
  13. })
  14. .then((result) => {
  15. console.log(result);
  16. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement