mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-10-07 22:57:07 +00:00
Add doc for peer event
This commit is contained in:
8
API.md
8
API.md
@@ -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 the new peer, an instance of [`peerInfo`](https://github.com/libp2p/js-peer-info)
|
||||
|
||||
### `closed`
|
||||
Emitted once the database has finished closing.
|
||||
```javascript
|
||||
|
||||
Reference in New Issue
Block a user