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: lib/node_modules/@stdlib/utils/compose-async/README.md
+13-14
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# funseqAsync
1
+
# composeAsync
2
2
3
-
> Function sequence.
3
+
> [Function composition][function-composition].
4
4
5
5
6
6
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
Returns a pipeline function. Starting from the left, the pipeline function evaluates each function and passes the result as the first argument to the next function. The result of the rightmost function is the result of the whole.
26
+
Returns a composite function. Starting from the right, the composite function evaluates each function and passes the result as the first argument to the next function. The result of the leftmost function is the result of the whole.
27
27
28
28
```javascript
29
29
functiona( x, next ) {
@@ -47,7 +47,7 @@ function c( x, next ) {
47
47
}
48
48
}
49
49
50
-
var f =funseqAsync( a, b, c );
50
+
var f =composeAsync( c, b, a );
51
51
52
52
functiondone( error, result ) {
53
53
if ( error ) {
@@ -60,12 +60,12 @@ function done( error, result ) {
60
60
f( 6, done ); // ((2*x)+3)/5
61
61
```
62
62
63
-
The last argument provided to each function is a `next` callback which accepts two arguments:
63
+
The last argument provided to each composed function is a `next` callback which accepts two arguments:
64
64
65
65
*`error`: error argument
66
66
*`result`: function result
67
67
68
-
__Only__ the leftmost function is explicitly permitted to accept multiple arguments. All other functions are evaluated as __binary__ functions.
68
+
__Only__ the rightmost function is explicitly permitted to accept multiple arguments. All other functions are evaluated as __binary__ functions.
69
69
70
70
```javascript
71
71
functiona( x, y, next ) {
@@ -82,7 +82,7 @@ function b( r, next ) {
82
82
}
83
83
}
84
84
85
-
var f =funseqAsync( a, b );
85
+
var f =composeAsync( b, a );
86
86
87
87
functiondone( error, result ) {
88
88
if ( error ) {
@@ -106,9 +106,8 @@ f( 4, 6, done );
106
106
## Notes
107
107
108
108
* The function will throw if provided fewer than `2` input arguments.
109
-
* If a provided function calls the `next` callback with a truthy `error` argument, the pipeline function suspends execution and immediately calls the `done` callback for subsequent `error` handling.
109
+
* If a composed function calls the `next` callback with a truthy `error` argument, the function suspends execution and immediately calls the `done` callback for subsequent `error` handling.
110
110
* Execution is __not__ guaranteed to be asynchronous. To guarantee asynchrony, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setIntermediate`, `setTimeout`).
111
-
* The difference between this function and [`composeAsync`][@stdlib/utils/compose-async] is that this function evaluates input arguments from left-to-right, rather than right-to-left.
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/utils/function-sequence-async/README.md
+14-13
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# composeAsync
1
+
# funseqAsync
2
2
3
-
> [Function composition][function-composition].
3
+
> Function sequence.
4
4
5
5
6
6
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
Returns a composite function. Starting from the right, the composite function evaluates each function and passes the result as the first argument to the next function. The result of the leftmost function is the result of the whole.
26
+
Returns a pipeline function. Starting from the left, the pipeline function evaluates each function and passes the result as the first argument to the next function. The result of the rightmost function is the result of the whole.
27
27
28
28
```javascript
29
29
functiona( x, next ) {
@@ -47,7 +47,7 @@ function c( x, next ) {
47
47
}
48
48
}
49
49
50
-
var f =composeAsync( c, b, a );
50
+
var f =funseqAsync( a, b, c );
51
51
52
52
functiondone( error, result ) {
53
53
if ( error ) {
@@ -60,12 +60,12 @@ function done( error, result ) {
60
60
f( 6, done ); // ((2*x)+3)/5
61
61
```
62
62
63
-
The last argument provided to each composed function is a `next` callback which accepts two arguments:
63
+
The last argument provided to each function is a `next` callback which accepts two arguments:
64
64
65
65
*`error`: error argument
66
66
*`result`: function result
67
67
68
-
__Only__ the rightmost function is explicitly permitted to accept multiple arguments. All other functions are evaluated as __binary__ functions.
68
+
__Only__ the leftmost function is explicitly permitted to accept multiple arguments. All other functions are evaluated as __binary__ functions.
69
69
70
70
```javascript
71
71
functiona( x, y, next ) {
@@ -82,7 +82,7 @@ function b( r, next ) {
82
82
}
83
83
}
84
84
85
-
var f =composeAsync( b, a );
85
+
var f =funseqAsync( a, b );
86
86
87
87
functiondone( error, result ) {
88
88
if ( error ) {
@@ -106,8 +106,9 @@ f( 4, 6, done );
106
106
## Notes
107
107
108
108
* The function will throw if provided fewer than `2` input arguments.
109
-
* If a composed function calls the `next` callback with a truthy `error` argument, the function suspends execution and immediately calls the `done` callback for subsequent `error` handling.
109
+
* If a provided function calls the `next` callback with a truthy `error` argument, the pipeline function suspends execution and immediately calls the `done` callback for subsequent `error` handling.
110
110
* Execution is __not__ guaranteed to be asynchronous. To guarantee asynchrony, wrap the `done` callback in a function which either executes at the end of the current stack (e.g., `nextTick`) or during a subsequent turn of the event loop (e.g., `setIntermediate`, `setTimeout`).
111
+
* The difference between this function and [`composeAsync`][@stdlib/utils/compose-async] is that this function evaluates input arguments from left-to-right, rather than right-to-left.
0 commit comments