pull-pushable-linked
v1.0.1
Published
A pull-stream source with a pushable interface using a linked list.
Downloads
3
Readme
pull-pushable-linked
A pull-stream source with a pushable interface using a linked list.
Interface
import PullPushable from 'pull-pushable-linked'
const {
source, // pull-stream source (allows not exposing other methods to consumers)
push, // (chunk) => void
end, // ([error]) => void
getList, // () => ({ head, tail }),
} = PullPushable([onEnd])
Example
import PullPushable from 'pull-pushable-linked'
import PullStream from 'pull-stream
const {pull, drain} = PullStream
const pushable = PullPushable((err) => {
console.log('Ended', err)
})
pull(pushable, drain(console.log))
pushable.push('Hello')
pushable.end()