Merge pull request #689 from orbitdb/doc/peer-event

Add doc for peer event
This commit is contained in:
shamb0t
2019-09-20 08:22:45 +01:00
committed by GitHub

8
API.md
View File

@@ -62,6 +62,7 @@ Read the **[GETTING STARTED](https://github.com/orbitdb/orbit-db/blob/master/GUI
+ [`load.progress`](#loadprogress)
* [`ready`](#ready)
* [`write`](#write)
* [`peer`](#peer)
* [`closed`](#closed)
<!-- tocstop -->
@@ -603,6 +604,13 @@ db.events.on('write', (dbname, hash, entry) => ... )
Emitted after an entry was added locally to the database. *hash* is the IPFS hash of the latest state of the database. *entry* is the added database op.
### `peer`
```javascript
db.events.on('peer', (peer) => ... )
```
Emitted when a new peer connects via ipfs pubsub. *peer* is a string containing the id of the new peer
### `closed`
Emitted once the database has finished closing.
```javascript