Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var once =async function() {
- if(once.done){
- console.log("doing it on realease of done")
- return
- };
- once.done = true;
- await inner().then((result) =>{
- console.log(result)
- once.done =false})
- };
- const inner =async function(){
- setTimeout(await inner,5000)
- clearTimeout(inner);
- return "Doing it once";
- }
- once();
- once();
- once();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement