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

24
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.disconnect()
Close databases, connections, pubsub and reset orbitdb state.
```javascript
await orbitdb.disconnect()
```
### orbitdb.stop() ### orbitdb.stop()
Stop OrbitDB, close databases and disconnect the databases from the network. Alias for `orbitdb.disconnect()`
```javascript
```javascript await orbitdb.stop()
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,55 +140,57 @@ 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.keyvalue(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbkeyvaluenameaddress) - [orbitdb.create(name|address, type, [options])](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcreatename-type-options)
- [kv.put(key, value)](https://github.com/orbitdb/orbit-db/blob/master/API.md#putkey-value) - [orbitdb.open(name|address, [options])](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbopenaddress-options)
- [kv.set(key, value)](https://github.com/orbitdb/orbit-db/blob/master/API.md#setkey-value) - [orbitdb.disconnect()](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdisconnect)
- [kv.get(key)](https://github.com/orbitdb/orbit-db/blob/master/API.md#getKey) - [orbitdb.stop()](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbstop)
- [orbitdb.log(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdblognameaddress) - [orbitdb.keyvalue(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbkeyvaluenameaddress)
- [log.add(event)](https://github.com/orbitdb/orbit-db/blob/master/API.md#addevent) - [kv.put(key, value)](https://github.com/orbitdb/orbit-db/blob/master/API.md#putkey-value)
- [log.get(hash)](https://github.com/orbitdb/orbit-db/blob/master/API.md#gethash) - [kv.set(key, value)](https://github.com/orbitdb/orbit-db/blob/master/API.md#setkey-value)
- [log.iterator([options])](https://github.com/orbitdb/orbit-db/blob/master/API.md#iteratoroptions) - [kv.get(key)](https://github.com/orbitdb/orbit-db/blob/master/API.md#getKey)
- [orbitdb.feed(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbfeednameaddress) - [orbitdb.log(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdblognameaddress)
- [feed.add(data)](https://github.com/orbitdb/orbit-db/blob/master/API.md#adddata) - [log.add(event)](https://github.com/orbitdb/orbit-db/blob/master/API.md#addevent)
- [feed.get(hash)](https://github.com/orbitdb/orbit-db/blob/master/API.md#gethash-1) - [log.get(hash)](https://github.com/orbitdb/orbit-db/blob/master/API.md#gethash)
- [feed.remove(hash)](https://github.com/orbitdb/orbit-db/blob/master/API.md#removehash) - [log.iterator([options])](https://github.com/orbitdb/orbit-db/blob/master/API.md#iteratoroptions)
- [feed.iterator([options])](https://github.com/orbitdb/orbit-db/blob/master/API.md#iteratoroptions-1) - [orbitdb.feed(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbfeednameaddress)
- [orbitdb.docs(name|address, options)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdocsnameaddress-options) - [feed.add(data)](https://github.com/orbitdb/orbit-db/blob/master/API.md#adddata)
- [docs.put(doc)](https://github.com/orbitdb/orbit-db/blob/master/API.md#putdoc) - [feed.get(hash)](https://github.com/orbitdb/orbit-db/blob/master/API.md#gethash-1)
- [docs.get(hash)](https://github.com/orbitdb/orbit-db/blob/master/API.md#getkey-1) - [feed.remove(hash)](https://github.com/orbitdb/orbit-db/blob/master/API.md#removehash)
- [docs.query(mapper)](https://github.com/orbitdb/orbit-db/blob/master/API.md#querymapper) - [feed.iterator([options])](https://github.com/orbitdb/orbit-db/blob/master/API.md#iteratoroptions-1)
- [del(key)](https://github.com/orbitdb/orbit-db/blob/master/API.md#delkey) - [orbitdb.docs(name|address, options)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdocsnameaddress-options)
- [orbitdb.counter(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress) - [docs.put(doc)](https://github.com/orbitdb/orbit-db/blob/master/API.md#putdoc)
- [counter.value](https://github.com/orbitdb/orbit-db/blob/master/API.md#value) - [docs.get(hash)](https://github.com/orbitdb/orbit-db/blob/master/API.md#getkey-1)
- [counter.inc([value])](https://github.com/orbitdb/orbit-db/blob/master/API.md#incvalue) - [docs.query(mapper)](https://github.com/orbitdb/orbit-db/blob/master/API.md#querymapper)
- [orbitdb.create(name|address, type, [options])]() - [del(key)](https://github.com/orbitdb/orbit-db/blob/master/API.md#delkey)
- [orbitdb.open(name|address, [options])]() - [orbitdb.counter(name|address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress)
- [orbitdb.stop()](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbstop) - [counter.value](https://github.com/orbitdb/orbit-db/blob/master/API.md#value)
- [orbitdb.disconnect()](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdisconnect) - [counter.inc([value])](https://github.com/orbitdb/orbit-db/blob/master/API.md#incvalue)
- **Static Properties**
- [OrbitDB.databaseTypes](https://github.com/orbitdb/orbit-db/blob/master/API.md#databasetypes)
- **Static Methods**
- [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.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.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) **Static Properties**
- [load()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeload) - [OrbitDB.databaseTypes](https://github.com/orbitdb/orbit-db/blob/master/API.md#databasetypes)
- [close()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeclose)
- [drop()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storedrop) **Static Methods**
- [key](https://github.com/orbitdb/orbit-db/blob/master/API.md#storekey) - [OrbitDB.isValidType(type)](https://github.com/orbitdb/orbit-db/blob/master/API.md#isvalidtypetype)
- [type](https://github.com/orbitdb/orbit-db/blob/master/API.md#storetype) - [OrbitDB.addDatabaseType(type, store)](https://github.com/orbitdb/orbit-db/blob/master/API.md#adddatabasetypetype-store)
- [Store Events](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeevents) - [OrbitDB.getDatabaseTypes()](https://github.com/orbitdb/orbit-db/blob/master/API.md#getdatabasetypes)
- [replicated](https://github.com/orbitdb/orbit-db/blob/master/API.md#replicated) - [OrbitDB.isValidAddress(address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#isvalidaddressaddress)
- [replicate](https://github.com/orbitdb/orbit-db/blob/master/API.md#replicate) - [OrbitDB.parseAddress(address)](https://github.com/orbitdb/orbit-db/blob/master/API.md#parseaddressaddress)
- [replicate.progress](https://github.com/orbitdb/orbit-db/blob/master/API.md#replicateprogress)
- [load](https://github.com/orbitdb/orbit-db/blob/master/API.md#load-1) **[Store API](https://github.com/orbitdb/orbit-db/blob/master/API.md#store)**
- [load.progress](https://github.com/orbitdb/orbit-db/blob/master/API.md#loadprogress) - [load()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeload)
- [ready](https://github.com/orbitdb/orbit-db/blob/master/API.md#ready) - [close()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storeclose)
- [write](https://github.com/orbitdb/orbit-db/blob/master/API.md#write) - [drop()](https://github.com/orbitdb/orbit-db/blob/master/API.md#storedrop)
- [key](https://github.com/orbitdb/orbit-db/blob/master/API.md#storekey)
- [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)**
- [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.progress](https://github.com/orbitdb/orbit-db/blob/master/API.md#replicateprogress)
- [load](https://github.com/orbitdb/orbit-db/blob/master/API.md#load-1)
- [load.progress](https://github.com/orbitdb/orbit-db/blob/master/API.md#loadprogress)
- [ready](https://github.com/orbitdb/orbit-db/blob/master/API.md#ready)
- [write](https://github.com/orbitdb/orbit-db/blob/master/API.md#write)
### Custom Store Types ### Custom Store Types