@live-change/dao 0.8.20 → 0.8.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,7 +19,7 @@ class Observation {
|
|
|
19
19
|
if(this.disposed) throw new Error("observation use after disposal")
|
|
20
20
|
this.observables.push(observable)
|
|
21
21
|
observable.observation = this
|
|
22
|
-
if(this.observables.length
|
|
22
|
+
if(this.observables.length === 1 && this.connection.connected) {
|
|
23
23
|
this.connection.sendObserve(this)
|
|
24
24
|
}
|
|
25
25
|
//process.nextTick(() => { // next tick will replay events through all layer to the client - it's waste of resources
|
|
@@ -32,7 +32,7 @@ class Observation {
|
|
|
32
32
|
}
|
|
33
33
|
observable(clazz) {
|
|
34
34
|
if(this.disposed) throw new Error("observation use after disposal")
|
|
35
|
-
let observable = this.observables.find(o => o.clazz
|
|
35
|
+
let observable = this.observables.find(o => o.clazz === clazz)
|
|
36
36
|
if(observable) return observable
|
|
37
37
|
|
|
38
38
|
const what = this.what
|
|
@@ -318,7 +318,7 @@ class Connection extends EventEmitter {
|
|
|
318
318
|
this.requestsQueue.push(req)
|
|
319
319
|
if(req.settings.requestSendTimeout < Infinity) {
|
|
320
320
|
setTimeout(() => {
|
|
321
|
-
if(queuedConnectionId
|
|
321
|
+
if(queuedConnectionId === this.connectedCounter && this.requestsQueue[queuedId]) {
|
|
322
322
|
req.handler('disconnected')
|
|
323
323
|
this.requestsQueue[queuedId] = null
|
|
324
324
|
}
|
package/package.json
CHANGED