Skip to content

Commit bcc5431

Browse files
committed
Fix document swap
1 parent 5a4fde7 commit bcc5431

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

lib/node_modules/@stdlib/utils/compose-async/README.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# funseqAsync
1+
# composeAsync
22

3-
> Function sequence.
3+
> [Function composition][function-composition].
44
55

66
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
@@ -18,12 +18,12 @@
1818
## Usage
1919

2020
``` javascript
21-
var funseqAsync = require( '@stdlib/utils/function-sequence-async' );
21+
var composeAsync = require( '@stdlib/utils/compose-async' );
2222
```
2323

24-
#### funseqAsync( ...fcn )
24+
#### composeAsync( ...fcn )
2525

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.
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.
2727

2828
``` javascript
2929
function a( x, next ) {
@@ -47,7 +47,7 @@ function c( x, next ) {
4747
}
4848
}
4949

50-
var f = funseqAsync( a, b, c );
50+
var f = composeAsync( c, b, a );
5151

5252
function done( error, result ) {
5353
if ( error ) {
@@ -60,12 +60,12 @@ function done( error, result ) {
6060
f( 6, done ); // ((2*x)+3)/5
6161
```
6262

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:
6464

6565
* `error`: error argument
6666
* `result`: function result
6767

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.
6969

7070
``` javascript
7171
function a( x, y, next ) {
@@ -82,7 +82,7 @@ function b( r, next ) {
8282
}
8383
}
8484

85-
var f = funseqAsync( a, b );
85+
var f = composeAsync( b, a );
8686

8787
function done( error, result ) {
8888
if ( error ) {
@@ -106,9 +106,8 @@ f( 4, 6, done );
106106
## Notes
107107

108108
* 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.
110110
* 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.
112111

113112
</section>
114113

@@ -121,7 +120,7 @@ f( 4, 6, done );
121120
## Examples
122121

123122
``` javascript
124-
var funseqAsync = require( '@stdlib/utils/function-sequence-async' );
123+
var composeAsync = require( '@stdlib/utils/compose-async' );
125124

126125
function a( x, y, next ) {
127126
setTimeout( onTimeout, 0 );
@@ -144,7 +143,7 @@ function c( r, next ) {
144143
}
145144
}
146145

147-
var f = funseqAsync( a, b, c );
146+
var f = composeAsync( c, b, a );
148147

149148
function done( error, result ) {
150149
if ( error ) {
@@ -173,7 +172,7 @@ f( 5, 3, done );
173172

174173
<section class="links">
175174

176-
[@stdlib/utils/compose-async]: https://github.com/stdlib-js/stdlib
175+
[function-composition]: https://en.wikipedia.org/wiki/Function_composition_%28computer_science%29
177176

178177
</section>
179178

lib/node_modules/@stdlib/utils/function-sequence-async/README.md

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# composeAsync
1+
# funseqAsync
22

3-
> [Function composition][function-composition].
3+
> Function sequence.
44
55

66
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
@@ -18,12 +18,12 @@
1818
## Usage
1919

2020
``` javascript
21-
var composeAsync = require( '@stdlib/utils/compose-async' );
21+
var funseqAsync = require( '@stdlib/utils/function-sequence-async' );
2222
```
2323

24-
#### composeAsync( ...fcn )
24+
#### funseqAsync( ...fcn )
2525

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.
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.
2727

2828
``` javascript
2929
function a( x, next ) {
@@ -47,7 +47,7 @@ function c( x, next ) {
4747
}
4848
}
4949

50-
var f = composeAsync( c, b, a );
50+
var f = funseqAsync( a, b, c );
5151

5252
function done( error, result ) {
5353
if ( error ) {
@@ -60,12 +60,12 @@ function done( error, result ) {
6060
f( 6, done ); // ((2*x)+3)/5
6161
```
6262

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:
6464

6565
* `error`: error argument
6666
* `result`: function result
6767

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.
6969

7070
``` javascript
7171
function a( x, y, next ) {
@@ -82,7 +82,7 @@ function b( r, next ) {
8282
}
8383
}
8484

85-
var f = composeAsync( b, a );
85+
var f = funseqAsync( a, b );
8686

8787
function done( error, result ) {
8888
if ( error ) {
@@ -106,8 +106,9 @@ f( 4, 6, done );
106106
## Notes
107107

108108
* 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.
110110
* 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.
111112

112113
</section>
113114

@@ -120,7 +121,7 @@ f( 4, 6, done );
120121
## Examples
121122

122123
``` javascript
123-
var composeAsync = require( '@stdlib/utils/compose-async' );
124+
var funseqAsync = require( '@stdlib/utils/function-sequence-async' );
124125

125126
function a( x, y, next ) {
126127
setTimeout( onTimeout, 0 );
@@ -143,7 +144,7 @@ function c( r, next ) {
143144
}
144145
}
145146

146-
var f = composeAsync( c, b, a );
147+
var f = funseqAsync( a, b, c );
147148

148149
function done( error, result ) {
149150
if ( error ) {
@@ -172,7 +173,7 @@ f( 5, 3, done );
172173

173174
<section class="links">
174175

175-
[function-composition]: https://en.wikipedia.org/wiki/Function_composition_%28computer_science%29
176+
[@stdlib/utils/compose-async]: https://github.com/stdlib-js/stdlib
176177

177178
</section>
178179

0 commit comments

Comments
 (0)