From c389020884d9e10a59a5a25be7df0c299c0b128d Mon Sep 17 00:00:00 2001 From: Francisco Baio Dias Date: Sun, 20 Mar 2016 17:25:17 +0000 Subject: [PATCH] Rename callback to ready again --- src/index.js | 4 ++-- tests/libp2p-websockets-test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index b215bb7..6027665 100644 --- a/src/index.js +++ b/src/index.js @@ -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] } diff --git a/tests/libp2p-websockets-test.js b/tests/libp2p-websockets-test.js index 59f347f..dc43182 100644 --- a/tests/libp2p-websockets-test.js +++ b/tests/libp2p-websockets-test.js @@ -90,7 +90,7 @@ describe('libp2p-websockets', function () { const message = 'Hello World!' const conn = ws.dial(mh, { - connect: () => { + ready: () => { conn.send(message) } })