experimenting + notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-12-25 23:14:59 +03:00
parent 37f97f5981
commit dcad00512e

View File

@ -336,6 +336,14 @@ object.Constructor('IterablePromise', Promise, {
return list
[map](function(elem){
//* XXX migrate code from old .__pack(..)...
// XXX these are not the same:
// await Promise.iter(['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])])
// and:
// await Promise.iter(['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])], e => e)
// this produces the correct result:
// await Promise.iter(['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])], e => [e])
// this does not flatten the promise:
// await Promise.iter(['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])]).flat()
return elem instanceof IterablePromise ?
(elem.isSync() ?
handler(elem.sync())