From e6a19e905c5fab54d1364a623d12c6bfb1f6c7e3 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 8 Jun 2022 03:38:47 +0300 Subject: [PATCH] refactoring... Signed-off-by: Alex A. Naanou --- Promise.js | 16 ++++++---------- package.json | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Promise.js b/Promise.js index 2114a46..f6206fa 100644 --- a/Promise.js +++ b/Promise.js @@ -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){ diff --git a/package.json b/package.json index 8d7497b..7c39bea 100644 --- a/package.json +++ b/package.json @@ -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": {