Merge branch 'master' of github.com:flynx/types.js

This commit is contained in:
Alex A. Naanou 2022-06-10 01:24:43 +03:00
commit 9918529fac

View File

@ -3,6 +3,7 @@
* This defines the following extensions to Promise:
*
* Promise.iter(seq)
* <promise>.iter()
* Iterable promise object.
* Similar to Promise.all(..) but adds basic iterator/generator
* API and will resolve the items as they are ready (resolved).
@ -16,6 +17,11 @@
* Exposes the API to resolve/reject the promise object
* externally.
*
* <promise>.as(obj)
* Promise proxy.
* Proxies the methods available from obj to promise value.
*
*
*
*
**********************************************/ /* c8 ignore next 2 */
@ -180,6 +186,7 @@ object.Constructor('IterablePromise', Promise, {
// .includes(..)
// .some(..) / .every(..)
// .sort(..)
// XXX update this note...
map: function(func){
return this.constructor(this,
function(e){
@ -353,8 +360,9 @@ object.Constructor('IterablePromise', Promise, {
//
//
// handler(e)
// -> [value]
// -> [value, ..]
// -> []
// -> <promise>
//
//
// NOTE: element index is unknowable until the full list is expanded