Class Index | File Index

Classes


Class Pot.Deferred#map


Defined in: <potlite.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
Pot.Deferred#map(callback, (context))
Creates a new object with the results of calling a provided function on every element in chains result.
Field Summary
Field Attributes Field Name and Description
 
Iterates "map" loop with slower speed.
 
Iterates "map" loop with fast speed.
 
Iterates "map" loop with slowest speed.
 
Iterates "map" loop with fastest speed.
 
Iterates "map" loop with default speed.
 
Iterates "map" loop with faster speed.
 
Iterates "map" loop with slow speed.
Class Detail
Pot.Deferred#map(callback, (context))
Creates a new object with the results of calling a provided function on every element in chains result. Iteration will use the results of the previous chain. This method like Array.prototype.map
  var d = new Pot.Deferred();
  d.then(function() {
    return ['foot', 'goose', 'moose'];
  }).map(function(word) {
    return word.replace(/o/g, 'e');
  }).then(function(result) {
    debug(result);
  }).begin();
  // @results result = ['feet', 'geese', 'meese']
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 "map" loop with slower speed.

{Function} fast
Iterates "map" loop with fast speed.

{Function} limp
Iterates "map" loop with slowest speed.

{Function} ninja
Iterates "map" loop with fastest speed.

{Function} normal
Iterates "map" loop with default speed.

{Function} rapid
Iterates "map" loop with faster speed.

{Function} slow
Iterates "map" loop with slow speed.

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Sep 21 2012 19:35:45 GMT+0900 (JST)