Guest User

Untitled

a guest
Feb 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. This is an implementation similar to `setInternal()` but will not start the delay/loop again until the callback has finished (presuming it returned a promise). Im interested to know if there's a better way to do this. I choose this rather than using `setInterval()` because I wanted to make sure it would not start over if the callback took longer than the interval time.
  2.  
  3. The callback function will only be called once an initial delay has passed. It would be simple to add a call to `cb()` before calling the loop.
  4.  
  5. Let me know what you think!
Add Comment
Please, Sign In to add comment