News for hackers. Stuff that matters.
Re:Go Replaces Interface{} with 'Any' by lucacasonato on Wednesday December 22, 2021 @06:31AM (#29647959)
Yeah, this should not be calling `Deno.sleepSync`... this should be an `await new Promise(resolve => setTimeout(resolve, 220));`.
Re:Go Replaces Interface{} with 'Any' by jshen on Thursday December 23, 2021 @12:09PM (#29663825)
That's kind of my point, it's less obvious how to do basic things in js/ts than golang.

What's the vanilla way in ts/js to do the equivalent of this golang code where getChoice makes an HTTP call and can't make more than 5 per second?

    for _, v := range choices {
      getChoice(v)
      time.Sleep(200)
    }
Also, why doesn't Deno.sleepSync work as I expect here?