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' );
4848* @returns {void }
4949*
5050* @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' );
5253*
53- * function done( error, results ) {
54- * if ( error ) {
55- * throw error;
56- * }
57- * console.log( results );
58- * }
54+ * var arr = [ 1, 2, 3, 4 ];
5955*
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+ * }
6563*
66- * function onFile ( error, data ) {
64+ * function done ( error, result ) {
6765* if ( error ) {
68- * return next( error ) ;
66+ * throw error ;
6967* }
70- * next( null, data );
71- * }
68+ * console.log( result );
69+ * // => [ 2, 4, 6, 8 ]
7270* }
7371*
74- * var files = [
75- * './beep.js',
76- * './boop.js'
77- * ];
78- *
79- * inmapAsync( files, read, done );
72+ * inmapAsync( arr, iterator, done );
8073*/
8174function inmapAsync ( collection , options , fcn , done ) {
8275 if ( arguments . length < 4 ) {
You can’t perform that action at this time.
0 commit comments