ig-types 6.12.0 → 6.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1389,7 +1389,7 @@ controlled(t.then())
|
|
|
1389
1389
|
// ...
|
|
1390
1390
|
```
|
|
1391
1391
|
|
|
1392
|
-
Note that functionally
|
|
1392
|
+
Note that this functionally can be considered a special-case of an
|
|
1393
1393
|
[interactive promise](#interactive-promises), but in reality they are two
|
|
1394
1394
|
different implementations, the main differences are:
|
|
1395
1395
|
- _Cooperative promise_ constructor does not need a resolver function,
|
|
@@ -1485,8 +1485,6 @@ var p = Promise.iter([ .. ])
|
|
|
1485
1485
|
// ...
|
|
1486
1486
|
})
|
|
1487
1487
|
// items reach here as soon as they are returned by the filter stage handler...
|
|
1488
|
-
// NOTE: the filter handler may return promises, those will not be processed
|
|
1489
|
-
// until they are resolved...
|
|
1490
1488
|
.map(function(e){
|
|
1491
1489
|
// ...
|
|
1492
1490
|
})
|
|
@@ -1504,6 +1502,12 @@ This approach has a number of advantages:
|
|
|
1504
1502
|
And some disadvantages:
|
|
1505
1503
|
- item indexes are unknowable until all the promises resolve.
|
|
1506
1504
|
|
|
1505
|
+
Calling each of the `<promise-iter>` methods will return a new and unresolved
|
|
1506
|
+
promise, even if the original is resolved.
|
|
1507
|
+
|
|
1508
|
+
If all values are resolved the `<promise-iter>` will resolve on the next
|
|
1509
|
+
execution frame.
|
|
1510
|
+
|
|
1507
1511
|
<!--
|
|
1508
1512
|
XXX should we support generators as input?
|
|
1509
1513
|
...not sure about the control flow direction here, on one hand the generator
|
|
@@ -1582,19 +1586,21 @@ and [`.reduce(..)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe
|
|
|
1582
1586
|
|
|
1583
1587
|
Note that these are different to `Array`'s equivalents in some details:
|
|
1584
1588
|
- `<handler>` is _not_ called in the order of element occurrence but rather
|
|
1585
|
-
|
|
1589
|
+
in the order of elements are resolved/ready.
|
|
1586
1590
|
- `<handler>` does not get either the element _index_ or the _container_.
|
|
1587
|
-
this is because
|
|
1588
|
-
index is
|
|
1591
|
+
this is because in _out-of-order_ and _depth-first_ execution the
|
|
1592
|
+
index is _unknowable_ and the container is a promise/black-box.
|
|
1589
1593
|
|
|
1590
|
-
This is especially critical for `.reduce(..)` as iteration in an order
|
|
1591
|
-
from the order of elements _can_ affect actual result if this is
|
|
1594
|
+
This is especially critical for `.reduce(..)` as the iteration in an order
|
|
1595
|
+
different from the order of elements _can_ affect actual result if this is
|
|
1596
|
+
not expected.
|
|
1592
1597
|
|
|
1593
1598
|
`.reduce(..)` is also a bit different here in that it will return a basic
|
|
1594
|
-
`<promise>` object as we can't know what
|
|
1599
|
+
`<promise>` rather than an iterable promise object as we can't know what
|
|
1600
|
+
will it will reduce to.
|
|
1595
1601
|
|
|
1596
|
-
Note that since `.reduce(..)` order can not be
|
|
1597
|
-
in implementing `.reduceRigth(..)`.
|
|
1602
|
+
Note that since `.reduce(..)` handler's execution order can not be known,
|
|
1603
|
+
there is no point in implementing `.reduceRigth(..)`.
|
|
1598
1604
|
|
|
1599
1605
|
|
|
1600
1606
|
#### `<promise-iter>.flat(..)`
|