How to use the consume function from highland

Find comprehensive JavaScript highland.consume code examples handpicked from public code repositorys.

21
22
23
24
25
26
27
28
29
30
      p(x).then((m) => {
        push(null, m)
      })
    }
  }
  return H.consume(ep)
}

H((push, next) => {
  console.log('*** GENERATOR ***', genc++)
fork icon0
star icon38
watch icon25

176
177
178
179
180
181
182
183
184
185
// @ts-ignore
_.batch(config.recordsPerBatch),

// * batch for req size
// @ts-ignore
_.consume(chunkForSize(config)),

// * send to mixpanel
// @ts-ignore
_.map((batch) => {
fork icon0
star icon13
watch icon6

+ 3 other calls in file

23
24
25
26
27
28
29
30
31
32
}

module.exports = function() {
    return H.pipeline(
        H.collect(),
        H.consume(function (err, x, push, next){
            if (err) {
                // pass errors along the stream and consume next value
                push(err);
                next();
fork icon1
star icon0
watch icon7

9
10
11
12
13
14
15
16
17
18
19
20


function Wrapper(begin, end) {
    var isStarted = false;


    return _.pipeline(
        _.consume(function (err, chunk, push, next) {
            if (err) {
                push(err);
                next();
                return;
fork icon0
star icon0
watch icon0

+ 3 other calls in file