Advertisement
sergeuniquite

Untitled

Aug 6th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       x() {
  2.         const tryouts = [500, 1000, 2000];
  3.         const increaseTryoutIndex = () => {
  4.           tryoutIndex += 1;
  5.         };
  6.  
  7.         /* remove odd elements */
  8.         const recursiveSetter = timeout => {
  9.           setTimeout(() => {
  10.             if (tryouts[tryoutIndex + 1] && ненайдено) {
  11.               /* retry */
  12.               делать_чтото
  13.              
  14.               increaseTryoutIndex();
  15.               recursiveSetter(tryouts[tryoutIndex]);
  16.             }
  17.           }, timeout);
  18.         };
  19.  
  20.         recursiveSetter(tryouts[tryoutIndex]);
  21.       },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement