From 88da467813ceb44a69c1a4dddce2b338374d8df0 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 29 Apr 2021 14:28:18 +0300 Subject: [PATCH] docs... Signed-off-by: Alex A. Naanou --- README.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a41cd79..2a9df4b 100644 --- a/README.md +++ b/README.md @@ -1417,7 +1417,7 @@ XXX should we support infinite generators as input? Create an _iterable promise_ ```bnf Promise.iter() - -> + -> ``` @@ -1425,11 +1425,40 @@ Promise.iter() +```bnf +.map() + -> + +.filter() + -> + +() +``` + +```bnf +.reduce(, ) + -> + +(, ) +``` + +Note that these are different to `Array`'s equivalents in some details: +- `` is _not_ called in the order of element occurrence but rather + in the order of elements are resolved/ready. +- `` does not get either the element _index_ or the _container_. + this is because the index with _out-of-order_ and _depth-first_ execution the + index is unknowable and the container is a promise/black-box. + #### `.flat(..)` - +```bnf +.flat() +.flat() + -> +``` +This is similar to [`.flat(..)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) see it for more info. #### `.then(..)` / `.catch(..)` / `.finally(..)`