mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
feat: updated dev deps + make pubsub.unsubscribe async
This commit is contained in:
parent
0f2da88fb4
commit
710d83bc2f
2709
package-lock.json
generated
2709
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -23,8 +23,8 @@
|
||||
"orbit-db-feedstore": "~1.4.0",
|
||||
"orbit-db-keystore": "~0.1.0",
|
||||
"orbit-db-kvstore": "~1.4.0",
|
||||
"orbit-db-store": "~2.5.0",
|
||||
"orbit-db-pubsub": "~0.5.3"
|
||||
"orbit-db-pubsub": "github:mistakia/orbit-db-pubsub#fix/unsubscribe",
|
||||
"orbit-db-store": "~2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.26.0",
|
||||
@ -34,9 +34,9 @@
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"datastore-level": "~0.7.0",
|
||||
"go-ipfs-dep": "0.4.13",
|
||||
"ipfs": "~0.28.2",
|
||||
"ipfs-repo": "~0.18.7",
|
||||
"ipfsd-ctl": "~0.30.3",
|
||||
"ipfs": "~0.30.0",
|
||||
"ipfs-repo": "~0.22.1",
|
||||
"ipfsd-ctl": "^0.37.5",
|
||||
"mocha": "^4.0.1",
|
||||
"p-each-series": "^1.0.0",
|
||||
"p-map-series": "^1.0.0",
|
||||
|
@ -97,8 +97,9 @@ class OrbitDB {
|
||||
Object.keys(this._directConnections).forEach(removeDirectConnect)
|
||||
|
||||
// Disconnect from pubsub
|
||||
if (this._pubsub)
|
||||
this._pubsub.disconnect()
|
||||
if (this._pubsub) {
|
||||
await this._pubsub.disconnect()
|
||||
}
|
||||
|
||||
// Remove all databases from the state
|
||||
this.stores = {}
|
||||
@ -191,12 +192,13 @@ class OrbitDB {
|
||||
}
|
||||
|
||||
// Callback when database was closed
|
||||
_onClose (address) {
|
||||
async _onClose (address) {
|
||||
logger.debug(`Close ${address}`)
|
||||
|
||||
// Unsubscribe from pubsub
|
||||
if(this._pubsub)
|
||||
this._pubsub.unsubscribe(address)
|
||||
if (this._pubsub) {
|
||||
await this._pubsub.unsubscribe(address)
|
||||
}
|
||||
|
||||
delete this.stores[address]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user