Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc for peer event #689

Merged
merged 3 commits into from
Sep 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down Expand Up @@ -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
Expand Down