JS: how to use generator and yield in a callback

前端 未结 0 1425
礼貌的吻别
礼貌的吻别 2021-02-12 16:56

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

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


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