lib/consumers/v2/wait.js
function waitObj(callback) {
  var data = [];

  return pipeline.obj(
    through.obj(
      function transform(chunk, enc, next) {
        data.push(chunk);

        next();
      },
      function Flush(next) {
        this.push(data);

        next();
      }
    ),
    throughWithCallback(callback)
  );
}
function waitObj(callback) {
  var data = [];

  return pipeline.obj(
    through.obj(
      function transform(chunk, enc, next) {
        data.push(chunk);

        next();
      },
      function Flush(next) {
        this.push(data);

        next();
      }
    ),
    throughWithCallback(callback)
  );
}
function waitObj ( callback ) { var data = [ ] ; return pipeline . obj ( through . obj ( function transform ( chunk , enc , next ) { data . push ( chunk ) ; next ( ) ; } , function Flush ( next ) { this . push ( data ) ; next ( ) ; } ) , throughWithCallback ( callback ) ) ; }
Creates a new stream with a single value that's an array of every item
in the stream.

@static
@method   wait.obj
@since    1.0.0
@category Consumers

@param    {Function} callback - A function to be called with the contents
of the stream. This is a convenience to
avoid listening to the data/end events of
the stream.
@returns  {Stream.Transform}  - Transform stream.

@example

// get all of the items in an object stream
objStream
.pipe(nodeStream.wait.obj());
// => [{ 'name': 'paul' }, { 'name': 'lisa' }, { 'name': 'mary' }]
Creates a new stream with a single value that s an array of every item in the stream .