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

Fortune for async-timeout-js's current commit: Blessing − 吉
allow-await-async-timeout-func
Avril 3 years ago
parent e58db0b0b9
commit 4f9c541715
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -48,10 +48,10 @@ const example = async (_timeout) => {
_timeout = _timeout || 100; _timeout = _timeout || 100;
// Wait 100 then alert "hi" // 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" // 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); }
}; };

Loading…
Cancel
Save