mirror of
https://github.com/fluencelabs/js-libp2p-websockets
synced 2025-05-25 14:21:20 +00:00
Rename callback to ready again
This commit is contained in:
parent
653f7473aa
commit
c389020884
@ -17,10 +17,10 @@ function WebSockets () {
|
||||
options = {}
|
||||
}
|
||||
|
||||
options.connect = options.connect || function noop () {}
|
||||
options.ready = options.ready || function noop () {}
|
||||
const maOpts = multiaddr.toOptions()
|
||||
const conn = new SWS('ws://' + maOpts.host + ':' + maOpts.port)
|
||||
conn.on('connect', options.connect)
|
||||
conn.on('connect', options.ready)
|
||||
conn.getObservedAddrs = () => {
|
||||
return [multiaddr]
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ describe('libp2p-websockets', function () {
|
||||
const message = 'Hello World!'
|
||||
|
||||
const conn = ws.dial(mh, {
|
||||
connect: () => {
|
||||
ready: () => {
|
||||
conn.send(message)
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user