mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
18 lines
441 B
Plaintext
18 lines
441 B
Plaintext
import { setImmediate } from "timers";
|
|
static function tick() {
|
|
return new Promise(resolve => setImmediate(() => setImmediate(resolve)));
|
|
}
|
|
|
|
<!-- Should merge scripts in the same writer.-->
|
|
$ out.script("console.log('hello')");
|
|
$ out.script("console.log('world')");
|
|
|
|
<!-- Should merge scripts in different writers.-->
|
|
<await(tick())>
|
|
<@then>
|
|
$ out.script("console.log('again')");
|
|
</>
|
|
</await>
|
|
|
|
$ out.script("console.log('and again')");
|