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