get rid of logs

promise-stale-fix
Rich Harris 8 hours ago
parent e1e04d0315
commit 2c0304ffec

@ -7,24 +7,20 @@
const r = Promise.withResolvers();
if (prev || v === '') {
console.log('hello', !!prev)
Promise.resolve().then(async () => {
console.log('count++')
count++;
r.resolve(v);
await new Promise(r => setTimeout(r, 0));
// TODO with a microtask like below it still throws a mutation error
// await Promise.resolve();
prev?.resolve();
})
});
} else {
console.log('other')
prev = Promise.withResolvers();
prev.promise.then(() => {
console.log('other coun++')
count++;
r.resolve(v)
})
});
}
return r.promise;

Loading…
Cancel
Save