Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
var Q = require("events");
exports.and = function (a, b) {
return Q.when(a, function (a) {
return Q.when(b, function (b) {
return a && b;
});
});
};
Q.when(exports.and(true, true), function (and) {
print(and);
});
var Q = require("events");
exports.and = function (a, b) {
return Q.when(a, function (a) {
return Q.when(b, function (b) {
return a && b;
});
});
};
var a = Q.defer();
var b = Q.defer();
Q.when(exports.and(a.promise, b.promise), function (and) {
print(and);
});
a.resolve(true);
b.resolve(false);
var Q = require("events");
exports.and = function (a, b) {
return Q.when(a, function (a) {
return Q.when(b, function (b) {
return a && b;
});
});
};
exports.all = function (values) {
return values.reduce(function (a, b) {
return exports.and(a, b);
});
};
Q.when(exports.all([true, true, true]), function (and) {
print(and);
});
var Q = require("events");
exports.and = function (a, b) {
return Q.when(a, function (a) {
return Q.when(b, function (b) {
return a && b;
});
});
};
exports.all = function (values) {
return values.reduce(function (a, b) {
return exports.and(a, b);
});
};
var deferred = Q.defer();
Q.when(exports.all([true, deferred.promise, true]), function (and) {
print(and);
});
deferred.resolve(false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.