Class Pot.Deferred#every
Defined in: <pot.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Pot.Deferred#every(callback, (context))
Tests whether all elements in the object pass the
test implemented by the provided function.
|
| Field Attributes | Field Name and Description |
|---|---|
|
Iterates "every" loop with slower speed.
|
|
|
Iterates "every" loop with fast speed.
|
|
|
Iterates "every" loop with slowest speed.
|
|
|
Iterates "every" loop with fastest speed.
|
|
|
Iterates "every" loop with default speed.
|
|
|
Iterates "every" loop with faster speed.
|
|
|
Iterates "every" loop with slow speed.
|
Class Detail
Pot.Deferred#every(callback, (context))
Tests whether all elements in the object pass the
test implemented by the provided function.
Iteration will use the results of the previous chain.
This method like Array.prototype.every
var d = new Pot.Deferred();
d.then(function() {
return [12, 5, 8, 130, 44];
}).every(function(value, index, array) {
return (value >= 10);
}).then(function(result) {
debug(result);
// @results false
}).then(function() {
return [12, 54, 18, 130, 44];
}).every(function(value, index, array) {
return (value >= 10);
}).then(function(result) {
debug(result);
// @results true
});
d.begin();
- Parameters:
- {Function} callback
- A callback function.
- {*} (context)
- (Optional) Object to use as `this` when executing callback.
- Returns:
- {Boolean} Return the Boolean result by callback.
Field Detail
{Function}
doze
Iterates "every" loop with slower speed.
{Function}
fast
Iterates "every" loop with fast speed.
{Function}
limp
Iterates "every" loop with slowest speed.
{Function}
ninja
Iterates "every" loop with fastest speed.
{Function}
normal
Iterates "every" loop with default speed.
{Function}
rapid
Iterates "every" loop with faster speed.
{Function}
slow
Iterates "every" loop with slow speed.