mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 06:57:03 +03:00
Promises (first look)
Thread dropdown Small fixes
This commit is contained in:
parent
dd41d30f9b
commit
c23ba31e17
61 changed files with 12442 additions and 130 deletions
21
vendors/Q/examples/async-generators/3-spawn.js
vendored
Normal file
21
vendors/Q/examples/async-generators/3-spawn.js
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
"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);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue