source: imaps-frontend/node_modules/asynckit/lib/readable_serial_ordered.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 941 bytes
Line 
1var serialOrdered = require('../serialOrdered.js');
2
3// API
4module.exports = ReadableSerialOrdered;
5// expose sort helpers
6module.exports.ascending = serialOrdered.ascending;
7module.exports.descending = serialOrdered.descending;
8
9/**
10 * Streaming wrapper to `asynckit.serialOrdered`
11 *
12 * @param {array|object} list - array or object (named list) to iterate over
13 * @param {function} iterator - iterator to run
14 * @param {function} sortMethod - custom sort function
15 * @param {function} callback - invoked when all elements processed
16 * @returns {stream.Readable#}
17 */
18function ReadableSerialOrdered(list, iterator, sortMethod, callback)
19{
20 if (!(this instanceof ReadableSerialOrdered))
21 {
22 return new ReadableSerialOrdered(list, iterator, sortMethod, callback);
23 }
24
25 // turn on object mode
26 ReadableSerialOrdered.super_.call(this, {objectMode: true});
27
28 this._start(serialOrdered, list, iterator, sortMethod, callback);
29}
Note: See TracBrowser for help on using the repository browser.