docs: add description for orbitdb.disconnect + update links

This commit is contained in:
Kia Rahimian 2018-07-13 15:30:09 -04:00
parent f4cb33b4aa
commit b045667cdd
2 changed files with 65 additions and 57 deletions

20
API.md
View File

@ -21,10 +21,10 @@ const db = await orbitdb.keyvalue('profile')
``` ```
**Public OrbitDB Instance Methods** **Public OrbitDB Instance Methods**
- [orbitdb.create(name, type, [options])]() - [orbitdb.create(name, type, [options])](#orbitdbcreatename-type-options)
- [orbitdb.open(name|address, [options])]() - [orbitdb.open(name|address, [options])](#orbitdbopenaddress-options)
- [orbitdb.disconnect()](#orbitdbdisconnect)
- [orbitdb.stop()](#orbitdbstop) - [orbitdb.stop()](#orbitdbstop)
- [orbitdb.disconnect()](orbitdbdisconnect)
- [orbitdb.keyvalue(name|address)](#orbitdbkeyvaluenameaddress) - [orbitdb.keyvalue(name|address)](#orbitdbkeyvaluenameaddress)
- [kv.put(key, value)](#putkey-value) - [kv.put(key, value)](#putkey-value)
- [kv.set(key, value)](#setkey-value) - [kv.set(key, value)](#setkey-value)
@ -105,14 +105,20 @@ Returns a `Promise` that resolves to [a database instance](#store). `address` (s
- `type` (string): A supported database type (i.e. `eventlog` or [an added custom type](https://github.com/orbitdb/orbit-db#custom-store-types)). Required if create is set to `true`. Otherwise it's used to validate the manifest. - `type` (string): A supported database type (i.e. `eventlog` or [an added custom type](https://github.com/orbitdb/orbit-db#custom-store-types)). Required if create is set to `true`. Otherwise it's used to validate the manifest.
- `overwrite` (boolean): Overwrite an existing database (Default: `false`) - `overwrite` (boolean): Overwrite an existing database (Default: `false`)
### orbitdb.stop() ### orbitdb.disconnect()
Stop OrbitDB, close databases and disconnect the databases from the network. Close databases, connections, pubsub and reset orbitdb state.
```javascript ```javascript
orbitdb.stop() await orbitdb.disconnect()
```
### orbitdb.stop()
Alias for `orbitdb.disconnect()`
```javascript
await orbitdb.stop()
``` ```
### orbitdb.disconnect()
### orbitdb.keyvalue(name|address) ### orbitdb.keyvalue(name|address)
> Creates and opens a keyvalue database > Creates and opens a keyvalue database

View File

@ -140,7 +140,11 @@ After creating an `OrbitDB` instance , you can access the different data stores.
*For further details, see usage for [kvstore](https://github.com/orbitdb/orbit-db-kvstore#usage), [eventlog](https://github.com/orbitdb/orbit-db-eventstore#usage), [feed](https://github.com/orbitdb/orbit-db-feedstore#usage), [docstore](https://github.com/orbitdb/orbit-db-docstore#usage) and [counter](https://github.com/orbitdb/orbit-db-counterstore#usage).* *For further details, see usage for [kvstore](https://github.com/orbitdb/orbit-db-kvstore#usage), [eventlog](https://github.com/orbitdb/orbit-db-eventstore#usage), [feed](https://github.com/orbitdb/orbit-db-feedstore#usage), [docstore](https://github.com/orbitdb/orbit-db-docstore#usage) and [counter](https://github.com/orbitdb/orbit-db-counterstore#usage).*
- **Public OrbitDB Instance Methods** **Public OrbitDB Instance Methods**
- [orbitdb.create(name|address, type, [options])](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcreatename-type-options)
- [orbitdb.open(name|address, [options])](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbopenaddress-options)
- [orbitdb.disconnect()](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdisconnect)
- [orbitdb.stop()](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbstop)
- [orbitdb.keyvalue(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbkeyvaluenameaddress) - [orbitdb.keyvalue(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbkeyvaluenameaddress)
- [kv.put(key, value)](https://github.com/orbitdb/orbit-db/blob/master/API.md#putkey-value) - [kv.put(key, value)](https://github.com/orbitdb/orbit-db/blob/master/API.md#putkey-value)
- [kv.set(key, value)](https://github.com/orbitdb/orbit-db/blob/master/API.md#setkey-value) - [kv.set(key, value)](https://github.com/orbitdb/orbit-db/blob/master/API.md#setkey-value)
@ -162,26 +166,24 @@ After creating an `OrbitDB` instance , you can access the different data stores.
- [orbitdb.counter(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress) - [orbitdb.counter(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress)
- [counter.value](https://github.com/orbitdb/orbit-db/blob/master/API.md#value) - [counter.value](https://github.com/orbitdb/orbit-db/blob/master/API.md#value)
- [counter.inc([value])](https://github.com/orbitdb/orbit-db/blob/master/API.md#incvalue) - [counter.inc([value])](https://github.com/orbitdb/orbit-db/blob/master/API.md#incvalue)
- [orbitdb.create(name|address, type, [options])]()
- [orbitdb.open(name|address, [options])]() **Static Properties**
- [orbitdb.stop()](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbstop)
- [orbitdb.disconnect()](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdisconnect)
- **Static Properties**
- [OrbitDB.databaseTypes](https://github.com/orbitdb/orbit-db/blob/master/API.md#databasetypes) - [OrbitDB.databaseTypes](https://github.com/orbitdb/orbit-db/blob/master/API.md#databasetypes)
- **Static Methods**
**Static Methods**
- [OrbitDB.isValidType(type)](https://github.com/orbitdb/orbit-db/blob/master/API.md#isvalidtypetype) - [OrbitDB.isValidType(type)](https://github.com/orbitdb/orbit-db/blob/master/API.md#isvalidtypetype)
- [OrbitDB.addDatabaseType(type, store)](https://github.com/orbitdb/orbit-db/blob/master/API.md#adddatabasetypetype-store) - [OrbitDB.addDatabaseType(type, store)](https://github.com/orbitdb/orbit-db/blob/master/API.md#adddatabasetypetype-store)
- [OrbitDB.getDatabaseTypes()](https://github.com/orbitdb/orbit-db/blob/master/API.md#getdatabasetypes) - [OrbitDB.getDatabaseTypes()](https://github.com/orbitdb/orbit-db/blob/master/API.md#getdatabasetypes)
- [OrbitDB.isValidAddress(address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#isvalidaddressaddress) - [OrbitDB.isValidAddress(address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#isvalidaddressaddress)
- [OrbitDB.parseAddress(address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#parseaddressaddress) - [OrbitDB.parseAddress(address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#parseaddressaddress)
- [Store API](https://github.com/orbitdb/orbit-db/blob/master/API.md#store) **[Store API](https://github.com/orbitdb/orbit-db/blob/master/API.md#store)**
- [load()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeload) - [load()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeload)
- [close()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeclose) - [close()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeclose)
- [drop()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storedrop) - [drop()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storedrop)
- [key](https://github.com/orbitdb/orbit-db/blob/master/API.md#storekey) - [key](https://github.com/orbitdb/orbit-db/blob/master/API.md#storekey)
- [type](https://github.com/orbitdb/orbit-db/blob/master/API.md#storetype) - [type](https://github.com/orbitdb/orbit-db/blob/master/API.md#storetype)
- [Store Events](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeevents) **[Store Events](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeevents)**
- [replicated](https://github.com/orbitdb/orbit-db/blob/master/API.md#replicated) - [replicated](https://github.com/orbitdb/orbit-db/blob/master/API.md#replicated)
- [replicate](https://github.com/orbitdb/orbit-db/blob/master/API.md#replicate) - [replicate](https://github.com/orbitdb/orbit-db/blob/master/API.md#replicate)
- [replicate.progress](https://github.com/orbitdb/orbit-db/blob/master/API.md#replicateprogress) - [replicate.progress](https://github.com/orbitdb/orbit-db/blob/master/API.md#replicateprogress)