refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-06-08 03:38:47 +03:00
parent a9ca990fc6
commit e6a19e905c
2 changed files with 7 additions and 11 deletions

View File

@ -246,20 +246,16 @@ object.Constructor('IterablePromise', Promise, {
var cur = this.__pack(this)
var other = this.__pack(other)
return this.constructor(
// NOTE: we are not using only the first branch to keep the
// lists as exposed as possible thus avoiding blocking
// until the whole ting is resolved...
// NOTE: we need to keep things as exposed as possible, this
// is why we're not blanketing all the cases with
// Promise.all(..)...
(cur instanceof Promise
&& other instanceof Promise) ?
Promise.all([cur, other])
.then(function(list){
return list[0].concat(list[1]) })
[cur, other]
: cur instanceof Promise ?
cur.then(function(list){
return list.concat(other) })
[cur, ...other]
: other instanceof Promise ?
other.then(function(list){
return cur.concat(list) })
[...cur, other]
: cur.concat(other),
'raw') },
push: function(elem){

View File

@ -1,6 +1,6 @@
{
"name": "ig-types",
"version": "6.13.4",
"version": "6.13.6",
"description": "Generic JavaScript types and type extensions...",
"main": "main.js",
"scripts": {