1.0.1 • Published 9 years ago

highland-callback v1.0.1

Weekly downloads
136
License
MIT
Repository
-
Last release
9 years ago

Highland Callback

Run callback after a stream is complete. This will run the callback once, on the first error or when the stream has finished. Note that you should only use this as the last .consume in the stream chain.

Install

npm install highland-callback

Usage

var _ = require('highland');
var highlandCallback = require('highland-callback');

_([1, 2, 3])
.consume(highlandCallback(function(error) {
  // executed after nil is seen, in this case all the values will be logged before this is executed
  console.log('executed');
  console.log('hi');
}))
.doto(function(value) {
  console.log(value);
})
.resume();

// output:
// 1
// 2
// 3
// executed
1.0.1

9 years ago

1.0.0

9 years ago