From 07b0cdc30e9c4c721571fa9e3704ef2879552f3d Mon Sep 17 00:00:00 2001 From: "Giovanni T. Parra" Date: Sun, 7 Jan 2018 16:47:02 -0200 Subject: [PATCH] docs: note the Connection type on .handle and .dial docs (#149) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d7e2445..2ea998e3 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,7 @@ class Node extends libp2p { - `peer`: can be an instance of [PeerInfo][], [PeerId][] or [multiaddr][] - `protocol`: String that defines the protocol (e.g '/ipfs/bitswap/1.1.0') +- `callback`: Function with signature `function (err, conn) {}` where `conn` is a [Connection](https://github.com/libp2p/interface-connection) object `callback` is a function with the following `function (err, conn) {}` signature, where `err` is an Error in of failure to dial the connection and `conn` is a [Connection][] instance in case of a protocol selected, if not it is undefined. @@ -196,7 +197,7 @@ class Node extends libp2p { > Handle new protocol - `protocol`: String that defines the protocol (e.g '/ipfs/bitswap/1.1.0') -- `handlerFunc`: Function with signature `function (protocol, conn) {}` +- `handlerFunc`: Function with signature `function (protocol, conn) {}` where `conn` is a [Connection](https://github.com/libp2p/interface-connection) object - `matchFunc`: Function for matching on protocol (exact matching, semver, etc). Default to exact match. #### `libp2p.unhandle(protocol)`