Class Pot.Deferred#forEver
Defined in: <potlite.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Pot.Deferred#forEver(callback, (context))
Iterates indefinitely until "Pot.StopIteration" is thrown.
|
| Field Attributes | Field Name and Description |
|---|---|
|
Iterates "forEver" loop with slower speed.
|
|
|
Iterates "forEver" loop with fast speed.
|
|
|
Iterates "forEver" loop with slowest speed.
|
|
|
Iterates "forEver" loop with fastest speed.
|
|
|
Iterates "forEver" loop with default speed.
|
|
|
Iterates "forEver" loop with faster speed.
|
|
|
Iterates "forEver" loop with slow speed.
|
Class Detail
Pot.Deferred#forEver(callback, (context))
Iterates indefinitely until "Pot.StopIteration" is thrown. (Asynchronous)
var d = new Pot.Deferred();
var s = '';
d.forEver(function(i) {
s += 'i=' + i + ',';
if (s.length > 25) {
throw Pot.StopIteration;
}
}).then(function() {
debug(s);
}).begin();
// @results s = 'i=0,i=1,i=2,i=3,i=4,i=5,i=6,'
- Parameters:
- {Function} callback
- An iterable function. Throw Pot.StopIteration if you want to stop the loop.
- {*} (context)
- Optionally, context object. (i.e. this)
- Returns:
- {Deferred} Return the Deferred.
Field Detail
{Function}
doze
Iterates "forEver" loop with slower speed.
{Function}
fast
Iterates "forEver" loop with fast speed.
{Function}
limp
Iterates "forEver" loop with slowest speed.
{Function}
ninja
Iterates "forEver" loop with fastest speed.
{Function}
normal
Iterates "forEver" loop with default speed.
{Function}
rapid
Iterates "forEver" loop with faster speed.
{Function}
slow
Iterates "forEver" loop with slow speed.