mirror of
https://github.com/flynx/types.js.git
synced 2025-10-28 18:10:08 +00:00
Merge branch 'master' of github.com:flynx/types.js
This commit is contained in:
commit
8b008d24f2
12
Promise.js
12
Promise.js
@ -199,8 +199,8 @@ function(list){
|
||||
return list.flat() }
|
||||
|
||||
//
|
||||
// onResolveItem(<list>, <onupdate>[, <ondone>])
|
||||
// onResolveItem(<list>, <options>)
|
||||
// itemResolved(<list>, <onupdate>[, <ondone>])
|
||||
// itemResolved(<list>, <options>)
|
||||
// -> <list>
|
||||
//
|
||||
// <onupdate>(<elem>, <index>, <list>)
|
||||
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user