乐趣区

关于javascript:Node-EventEmitter事件队列

var proxy = new events.EventEmitter()
var status = "ready"
var select = function(callback) {proxy.once("selected", callback)
  if (status === "ready") {
    status = "pending"
    setTimeout(() => {proxy.emit("selected", results)
      status = "ready"
    }, 2000)
  }
}
退出移动版