mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 02:20:07 +00:00
cleanup and notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
68b861bd5e
commit
bbe236d284
@ -836,7 +836,7 @@ object.Constructor('IterablePromise', Promise, {
|
||||
// NOTE: that here a promise will block handling of later promises even
|
||||
// if they are resolved before it.
|
||||
//
|
||||
// XXX BUG:
|
||||
// XXX BUG (FIXED):
|
||||
// await Promise.seqiter([
|
||||
// 1,
|
||||
// Promise.resolve(2),
|
||||
@ -847,11 +847,12 @@ object.Constructor('IterablePromise', Promise, {
|
||||
// -> [ 1, 2, [3], [[4]], [[[5]]] ]
|
||||
// looks like we need to flatten things...
|
||||
// XXX FIXED but need more testing...
|
||||
// XXX check if this behaves correctly (call order) on concatenation and
|
||||
// other methods...
|
||||
// XXX not sure if this is a viable strategy....
|
||||
var IterableSequentialPromise =
|
||||
module.IterableSequentialPromise =
|
||||
object.Constructor('IterableSequentialPromise', IterablePromise, {
|
||||
// XXX needs more work...
|
||||
__pack: function(list, handler=undefined, onerror=undefined){
|
||||
var seqiter = this.constructor
|
||||
|
||||
@ -864,7 +865,8 @@ object.Constructor('IterableSequentialPromise', IterablePromise, {
|
||||
&& i < list.length-1){
|
||||
res.push(e
|
||||
.then(function(e){
|
||||
return seqiter([...e, ...list.slice(i+1)])
|
||||
return seqiter(
|
||||
[...e, ...list.slice(i+1)])
|
||||
.flat() }))
|
||||
break }
|
||||
res.push(e) }
|
||||
@ -883,7 +885,6 @@ object.Constructor('IterableSequentialPromise', IterablePromise, {
|
||||
: list
|
||||
|
||||
return handler ?
|
||||
// XXX this seems to be wrong...
|
||||
this.__handle(list, handler, onerror)
|
||||
: list },
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user