diff --git a/Promise.js b/Promise.js index 4e03bcf..601511f 100644 --- a/Promise.js +++ b/Promise.js @@ -199,8 +199,8 @@ function(list){ return list.flat() } // -// onResolveItem(, [, ]) -// onResolveItem(, ) +// itemResolved(, [, ]) +// itemResolved(, ) // -> // // (, , ) @@ -216,8 +216,8 @@ function(list){ // } // // XXX rename to Promise.each(..) or Promise.eachPromise(..) ??? -var onResolveItem = -module.onResolveItem = +var itemResolved = +module.itemResolved = function(list, onupdate, ondone){ if(typeof(onupdate) != 'function'){ var {onupdate, ondone} = onupdate } @@ -230,7 +230,7 @@ function(list, onupdate, ondone){ onupdate(elem, i, list) }) } } return list } -// Like onResolveItem(..) but both onupdate and ondone are optional... +// Like itemResolved(..) but both onupdate and ondone are optional... // // XXX do not modify the array after this is called and until ondone(..) is called... // XXX should this know how to expand things??? @@ -240,7 +240,7 @@ function(list, onupdate, ondone){ if(onupdate && typeof(onupdate) != 'function'){ var {onupdate, ondone} = onupdate } - return onResolveItem(list, + return itemResolved(list, function(elem, i, list){ list[i] = elem typeof(onupdate) == 'function'