Remove setTimeout() when publishing to pubsub

This commit is contained in:
haad 2017-11-30 17:32:43 +01:00
parent 5f5479825d
commit 0bd85aed4a

View File

@ -122,7 +122,7 @@ class OrbitDB {
// Callback for local writes to the database. We the update to pubsub. // Callback for local writes to the database. We the update to pubsub.
_onWrite (address, entry, heads) { _onWrite (address, entry, heads) {
if(!heads) throw new Error("'heads' not defined") if(!heads) throw new Error("'heads' not defined")
if(this._pubsub) setImmediate(() => this._pubsub.publish(address, heads)) if(this._pubsub) this._pubsub.publish(address, heads)
} }
// Callback for receiving a message from the network // Callback for receiving a message from the network