Rename callback to ready again

This commit is contained in:
Francisco Baio Dias 2016-03-20 17:25:17 +00:00
parent 653f7473aa
commit c389020884
2 changed files with 3 additions and 3 deletions

View File

@ -17,10 +17,10 @@ function WebSockets () {
options = {} options = {}
} }
options.connect = options.connect || function noop () {} options.ready = options.ready || function noop () {}
const maOpts = multiaddr.toOptions() const maOpts = multiaddr.toOptions()
const conn = new SWS('ws://' + maOpts.host + ':' + maOpts.port) const conn = new SWS('ws://' + maOpts.host + ':' + maOpts.port)
conn.on('connect', options.connect) conn.on('connect', options.ready)
conn.getObservedAddrs = () => { conn.getObservedAddrs = () => {
return [multiaddr] return [multiaddr]
} }

View File

@ -90,7 +90,7 @@ describe('libp2p-websockets', function () {
const message = 'Hello World!' const message = 'Hello World!'
const conn = ws.dial(mh, { const conn = ws.dial(mh, {
connect: () => { ready: () => {
conn.send(message) conn.send(message)
} }
}) })