mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-06-13 16:49:04 +00:00
Created AsyncFunction (markdown)
parent
261ef1080a
commit
32eab6062b
15
AsyncFunction.md
Normal file
15
AsyncFunction.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
## AsyncFunction
|
||||||
|
|
||||||
|
JScript does not support the `async` keyword. So, Wilson JS uses the `AsyncFunction` class made by itself.
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
```js
|
||||||
|
var STD = require("lib/std");
|
||||||
|
|
||||||
|
[5, 4, 3, 2, 1].forEach(function(x) {
|
||||||
|
new AsyncFunction(function() {
|
||||||
|
sleep(x * 1000);
|
||||||
|
}).run();
|
||||||
|
});
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user