mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-10 00:38:04 +08:00
22 lines
296 B
JavaScript
22 lines
296 B
JavaScript
|
"use strict";
|
||
|
|
||
|
var Q = require("../../q");
|
||
|
|
||
|
function foo() {
|
||
|
return Q.delay(5, 1000);
|
||
|
}
|
||
|
|
||
|
function bar() {
|
||
|
return Q.delay(10, 1000);
|
||
|
}
|
||
|
|
||
|
Q.spawn(function* () {
|
||
|
var x = yield foo();
|
||
|
console.log(x);
|
||
|
|
||
|
var y = yield bar();
|
||
|
console.log(y);
|
||
|
|
||
|
console.log("result", x + y);
|
||
|
});
|