How to use the through function from pull-stream

Find comprehensive JavaScript pull-stream.through code examples handpicked from public code repositorys.

239
240
241
242
243
244
245
246
247
248
      l.push(ch.key)
    else
      l.push(ch)
  })

  return pull(l, pull.through(null, cleanup))

}

exports.read =
fork icon0
star icon1
watch icon3

+ 5 other calls in file

333
334
335
336
337
338
339
340
341
342
// pass messages to the processor
pull(
  source,

  // monitor disconnection
  pull.through(null, function() {
    queue = createQueue();
    readyState = RS_DISCONNECTED;
    signaller('disconnected');
  }),
fork icon19
star icon0
watch icon3

+ 3 other calls in file

1567
1568
1569
1570
1571
1572
1573
1574
1575
1576

  return recordStream
}),
pull.flatten(),
pull.filter((record) => isValueOk([op], record.value)),
pull.through(() => {
  if (debugQuery.enabled)
    debugQuery(
      `live(${getNameFromOperation(op)}): 1 new msg`.replace(/%/g, '%% ')
    )
fork icon6
star icon48
watch icon8

113
114
115
116
117
118
119
120
121
122
123
}


function startLogging (ssb) {
  pull(
    ssb.conn.peers(),
    pull.through(() => console.log(' ')),
    flatMap(evs => evs),
    pull.asyncMap((ev, cb) => {
      const { key: feedId, state } = ev[1]

fork icon2
star icon3
watch icon0

51
52
53
54
55
56
57
58
59
60

lastMessage = null

return pull(
  getStream(subOpts),
  pull.through(function (msg) {
    lastMessage = msg
  }),
  pull.filter(msg => {
    return !(msg && msg.resume)
fork icon0
star icon0
watch icon1

+ 11 other calls in file