JS: how to use generator and yield in a callback

前端 未结 0 1097
野的像风
野的像风 2021-02-12 16:57

I use JS generator to yield a value in a callback of setTimeout:

function* sleep() {
  // Using yield here is OK
  // yield 5; 
  setTimeout(functio         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题