You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -910,6 +910,19 @@ stream.await(): ---1--2--3->
910
910
911
911
Note that event order is preserved, regardless of promise fulfillment order. The fulfilled event values will arrive at the later of the original event time and the promise fulfillment time.
912
912
913
+
If a promise rejects, the stream will be in an error state with the rejected promise's reason as its error. See [flatMapError](#flatmaperror) for error recovery. For example:
914
+
915
+
```
916
+
promise p: ---1
917
+
promise q: ------X
918
+
promise r: -3
919
+
stream: -p---q---r->
920
+
stream.await(): ---1--X
921
+
```
922
+
923
+
Functionally, `stream.await()` and `stream.flatMap(most.fromPromise)` are equivalent, but `await` is much more efficient.
0 commit comments