Skip to content

Instantly share code, notes, and snippets.

@lachenmayer
Created September 20, 2016 22:27
Show Gist options
  • Save lachenmayer/50f4d401f20941a3048d6a85104561ee to your computer and use it in GitHub Desktop.
Save lachenmayer/50f4d401f20941a3048d6a85104561ee to your computer and use it in GitHub Desktop.
pull-ws-bug
const connect = require('pull-ws/client')
const pull = require('pull-stream')
const {source} = connect('ws://localhost:1337', (err, stream) => {
pull(
stream,
pull.log()
)
// expected: log 'hello!'
// actual: stream is undefined
})
// pull(
// source,
// pull.log()
// )
const createServer = require('pull-ws/server')
const pull = require('pull-stream')
createServer(stream => {
pull(
pull.once('hello!'),
stream
)
}).listen(1337)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment