File tree Expand file tree Collapse file tree 1 file changed +15
-22
lines changed
lib/node_modules/@stdlib/utils/async/inmap/lib Expand file tree Collapse file tree 1 file changed +15
-22
lines changed Original file line number Diff line number Diff line change @@ -48,35 +48,28 @@ var factory = require( './factory.js' );
48
48
* @returns {void }
49
49
*
50
50
* @example
51
- * var readFile = require( '@stdlib/fs/read-file' );
51
+ * var nextTick = require( '@stdlib/utils/next-tick' );
52
+ * var inmapAsync = require( '@stdlib/utils/async/inmap' );
52
53
*
53
- * function done( error, results ) {
54
- * if ( error ) {
55
- * throw error;
56
- * }
57
- * console.log( results );
58
- * }
54
+ * var arr = [ 1, 2, 3, 4 ];
59
55
*
60
- * function read( file, next ) {
61
- * var opts = {
62
- * 'encoding': 'utf8'
63
- * };
64
- * readFile( file, opts, onFile );
56
+ * function iterator( val, next ) {
57
+ * nextTick( cb );
58
+ * function cb() {
59
+ * // Return the value multiplied by 2...
60
+ * next( null, val*2 );
61
+ * }
62
+ * }
65
63
*
66
- * function onFile ( error, data ) {
64
+ * function done ( error, result ) {
67
65
* if ( error ) {
68
- * return next( error ) ;
66
+ * throw error ;
69
67
* }
70
- * next( null, data );
71
- * }
68
+ * console.log( result );
69
+ * // => [ 2, 4, 6, 8 ]
72
70
* }
73
71
*
74
- * var files = [
75
- * './beep.js',
76
- * './boop.js'
77
- * ];
78
- *
79
- * inmapAsync( files, read, done );
72
+ * inmapAsync( arr, iterator, done );
80
73
*/
81
74
function inmapAsync ( collection , options , fcn , done ) {
82
75
if ( arguments . length < 4 ) {
You can’t perform that action at this time.
0 commit comments