mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 15:07:02 +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/all.js
vendored
Normal file
21
vendors/Q/examples/all.js
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
"use strict";
|
||||
|
||||
var Q = require("../q");
|
||||
|
||||
function eventually(value) {
|
||||
return Q.delay(value, 1000);
|
||||
}
|
||||
|
||||
Q.all([1, 2, 3].map(eventually))
|
||||
.done(function (result) {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
Q.all([
|
||||
eventually(10),
|
||||
eventually(20)
|
||||
])
|
||||
.spread(function (x, y) {
|
||||
console.log(x, y);
|
||||
})
|
||||
.done();
|
||||
Loading…
Add table
Add a link
Reference in a new issue