Open aryanrajput opened 3 years ago
no need for any timers to get a reproduction, even just this simple code hangs:
import deasync from 'deasync'
const test = deasync(function(r, cb) {
Promise.resolve().then(()=>cb(null, r))
})
console.log(1)
console.log(test(2))
console.log(3)
var result = null; var isDone = false;
const p = new Promise((resolve, reject) => { setTimeout(function(){ console.log("This is set time out") resolve('resolved') }, 4000) })
p.then(res =>{ result = res; isDone = true; console.log("This is then section.") })
while(!isDone) { console.log("in while", result) deasync.sleep(10000); }
console.log(data)