- commit
- cf02ef0
- parent
- 0cba72f
- author
- Eric Bower
- date
- 2023-07-14 15:41:18 +0000 UTC
chore: fix readme fmt
1 files changed,
+4,
-3
+4,
-3
1@@ -16,7 +16,7 @@ Supercharged async flow control library.
2 ## example
3
4 ```ts
5-import { run, parallel, request, json } from 'starfx';
6+import { json, parallel, request, run } from "starfx";
7
8 function* fetchMovie(title: string) {
9 const response = yield* request(`/movies/${title}`);
10@@ -24,9 +24,10 @@ function* fetchMovie(title: string) {
11 return data;
12 }
13
14-const task = run(function*() {
15- const movies = ['titanic', 'avatar', 'good will hunting'];
16+const task = run(function* () {
17+ const movies = ["titanic", "avatar", "good will hunting"];
18 const ops = movies.map((title) => () => fetchMovie(title));
19+ // parallel returns a list of `Result` type
20 const group = yield* parallel(ops);
21 const results = yield* group;
22 return results;