Changed `exmaple()` to `console.log()` instead of `alert()`.

Fortune for async-timeout-js's current commit: Future blessing − 末吉
master
Avril 2 years ago
parent 881be9a6e7
commit ed32e1586b
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -37,10 +37,10 @@ const example = async (_timeout) => {
_timeout = _timeout || 100;
// Wait 100 then alert "hi"
alert(await (new AsyncTimeout(() => "hi", _timeout)).timeout());
console.log(await (new AsyncTimeout(() => "hi", _timeout)).timeout());
// Continuously wait 100 then alert "hi"
for await (const value of new AsyncTimeout(() => "hi forever", _timeout).interval()) { alert(value); }
for await (const value of new AsyncTimeout(() => "hi forever", _timeout).interval()) { console.log(value); }
};
//(async () => { example() })();

Loading…
Cancel
Save