We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
pipe
1 parent f6f3a75 commit 0998f46Copy full SHA for 0998f46
README.md
@@ -32,6 +32,21 @@ const result = pipe(
32
console.log(result); // "4"
33
```
34
35
+Or use `async` module to pipe a value through a series of asynchronous operator
36
+functions.
37
+
38
+```ts
39
+import { pipe } from "@core/pipe/async";
40
41
+const result = pipe(
42
+ 1,
43
+ (v) => Promise.resolve(v + 1), // inferred as (v: number) => number
44
+ (v) => Promise.resolve(v * 2), // inferred as (v: number) => number
45
+ (v) => Promise.resolve(v.toString()), // inferred as (v: number) => string
46
+);
47
+console.log(result); // "4"
48
+```
49
50
## License
51
52
The code follows MIT license written in [LICENSE](./LICENSE). Contributors need
0 commit comments