@aurox/distributed-observables
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -38,4 +38,5 @@ "use strict"; | ||
this.emit('error', result.message); | ||
return; | ||
} | ||
else if (result.status === 'conflict') { | ||
if (result.status === 'conflict') { | ||
this.emit('changing', this._currentState, result.actualState); | ||
@@ -45,4 +46,8 @@ this._currentState = result.actualState; | ||
this.emit('conflict-reported', `Failed to save changes for ${this._description}, due to stale state.`, result.actualState, result.actualRevision); | ||
return; | ||
} | ||
else if (this._patchesInQueue.length > 0) { | ||
if (result.status === 'success') { | ||
this._revision = result.newRevision; | ||
} | ||
if (this._patchesInQueue.length > 0) { | ||
this._debouncedPersist(); | ||
@@ -63,2 +68,3 @@ } | ||
}; | ||
this.setMaxListeners(Infinity); | ||
this._adaptor = adapter; | ||
@@ -65,0 +71,0 @@ this._topic = topic; |
{ | ||
"name": "@aurox/distributed-observables", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "A set of isomorphic helpers to enable distributed object sharing using the observer pattern", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -68,2 +68,4 @@ import { TypedEmitter } from 'tiny-typed-emitter'; | ||
this.setMaxListeners(Infinity); | ||
this._adaptor = adapter; | ||
@@ -166,3 +168,7 @@ this._topic = topic; | ||
this.emit('error', result.message); | ||
} else if (result.status === 'conflict') { | ||
return; | ||
} | ||
if (result.status === 'conflict') { | ||
this.emit('changing', this._currentState!, result.actualState as T); | ||
@@ -180,3 +186,11 @@ | ||
); | ||
} else if (this._patchesInQueue.length > 0) { | ||
return; | ||
} | ||
if (result.status === 'success') { | ||
this._revision = result.newRevision; | ||
} | ||
if (this._patchesInQueue.length > 0) { | ||
this._debouncedPersist(); | ||
@@ -183,0 +197,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83459
1516