mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-06-30 09:42:30 +00:00
Fix stores event hook up
This commit is contained in:
parent
b8e3e5397b
commit
c2d2a8a6cc
@ -55,17 +55,15 @@ class OrbitDB {
|
||||
_subscribe(store, dbname, subscribe, callback) {
|
||||
if(subscribe === undefined) subscribe = true;
|
||||
|
||||
return store.use(this.user.username).then((events) => {
|
||||
events.on('readable', this._onSync.bind(this));
|
||||
events.on('data', this._onWrite.bind(this));
|
||||
events.on('load', this._onLoad.bind(this));
|
||||
events.on('close', this._onClose.bind(this));
|
||||
store.events.on('readable', this._onSync.bind(this));
|
||||
store.events.on('data', this._onWrite.bind(this));
|
||||
store.events.on('load', this._onLoad.bind(this));
|
||||
store.events.on('close', this._onClose.bind(this));
|
||||
|
||||
if(subscribe)
|
||||
this._pubsub.subscribe(dbname, '', this._onMessage.bind(this));
|
||||
if(subscribe)
|
||||
this._pubsub.subscribe(dbname, '', this._onMessage.bind(this));
|
||||
|
||||
return;
|
||||
});
|
||||
return store.use(this.user.username);
|
||||
}
|
||||
|
||||
_onMessage(dbname, message) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user