This repository was archived by the owner on Jan 26, 2022. It is now read-only.
File tree 1 file changed +10
-9
lines changed
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -149,25 +149,26 @@ The promise will resolve to the final sub-function’s result.
149
149
``` js
150
150
Function .pipeAsync (input, ... fns);
151
151
152
- // Resolves to ((await (await fetch(url, options)).json()) + 1) * 2.
153
- await Function .pipeAsync (url,
152
+ // A promise that will resolve to ((await (await fetch(await url, options)).json()) + 1) * 2.
153
+ Function .pipeAsync (url,
154
154
x => fetch (x, options),
155
155
x => x .json (),
156
156
x => x + 1 ,
157
157
x => x * 2 ,
158
158
);
159
159
160
- // Resolves to 5.
161
- await Function .pipeAsync (5 );
160
+ // A promise that will resolve to 5.
161
+ Function .pipeAsync (5 );
162
162
163
- // Resolves to undefined.
164
- await Function .pipeAsync ();
163
+ // A promise that will resolve to undefined.
164
+ Function .pipeAsync ();
165
165
166
- // Rejects with a SyntaxError.
167
- await Function .pipeAsync (' x' , JSON .parse );
166
+ // A promise that will reject with a SyntaxError.
167
+ Function .pipeAsync (' x' , JSON .parse );
168
168
```
169
169
170
- The first sub-function is applied to ` input ` and then ` await ` ed,
170
+ The input is first ` await ` ed.
171
+ Then the first sub-function is applied to ` input ` and then ` await ` ed,
171
172
then the second sub-function is applied to the first sub-function’s result then ` await ` ed,
172
173
and so forth.
173
174
In other words, function piping occurs from left to right.
You can’t perform that action at this time.
0 commit comments