Skip to content

this idea might work better as a reverse pull-stream #2

@dominictarr

Description

@dominictarr

by that, I mean, based on two functions.

a through would look like this:

function through (write) {
  return function (data, end, cb) {
    return write(data, end, cb)
  }
}

and a readable would look like this:

function source (write) {
  var i = 0
  ;(function next (err) {
    if(err) return
    write(i++, end, next)
  })()
}

and a writable:

function sink (data, end, cb) {
  if(end) return cb(end)
  console.log(data)
  cb()
}

and join them together like this:

source(through(sink))

Which is kinda nice, which isn't to say I haven't been haveing a lot of success with pull-stream lately. @Raynos what do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions