diff --git a/asynctimeout.js b/asynctimeout.js index bfd5df1..6cc469b 100644 --- a/asynctimeout.js +++ b/asynctimeout.js @@ -22,7 +22,7 @@ function AsyncTimeout(thing, interval) } catch(e) { reject(e); } }, interval); }); - this.interval = async function*() => { + this.interval = async function*() { while(true) { yield await new Promise((resolve, reject) => { setTimeout(() => { @@ -43,4 +43,4 @@ const example = async (_timeout) => { for await (const value of new AsyncTimeout(() => "hi forever", _timeout).interval()) { alert(value); } }; - +//(async () => { example() })();