repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

commit
213be82
parent
d760ff8
author
Eric Bower
date
2023-09-02 14:50:22 +0000 UTC
doc: readme
1 files changed,  +2, -3
M README.md
+2, -3
 1@@ -30,7 +30,7 @@ article
 2 [The gotcha of unhandled promise rejections](https://jakearchibald.com/2023/unhandled-rejections/):
 3 
 4 ```ts
 5-import { json, main, parallel, request, each } from "starfx";
 6+import { each, json, main, parallel, request } from "starfx";
 7 
 8 function* fetchChapter(title: string) {
 9   const response = yield* request(`/chapters/${title}`);
10@@ -45,8 +45,7 @@ const task = main(function* () {
11   // parallel returns a list of `Result` type
12   const chapters = yield* parallel(ops);
13 
14-  // make http requests in parallel but process them in sequence (e.g. 01, 02,
15-  03)
16+  // make http requests in parallel but process them in sequence (e.g. 01, 02, 03)
17   for (const result of yield* each(chapters.sequence)) {
18     if (result.ok) {
19       console.log(result.value);