@nxtedition/deepstream.io-client-js 24.0.4 → 24.0.6
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.
- package/package.json +1 -1
- package/src/record/record-handler.js +0 -19
- package/src/record/record.js +0 -24
package/package.json
CHANGED
|
@@ -62,7 +62,6 @@ class RecordHandler {
|
|
|
62
62
|
this._client = client
|
|
63
63
|
this._records = new Map()
|
|
64
64
|
this._listeners = new Map()
|
|
65
|
-
this._pending = new Map()
|
|
66
65
|
this._pruning = new Set()
|
|
67
66
|
|
|
68
67
|
this._connected = 0
|
|
@@ -71,7 +70,6 @@ class RecordHandler {
|
|
|
71
70
|
created: 0,
|
|
72
71
|
destroyed: 0,
|
|
73
72
|
records: 0,
|
|
74
|
-
pending: 0,
|
|
75
73
|
pruning: 0,
|
|
76
74
|
patching: 0,
|
|
77
75
|
}
|
|
@@ -123,23 +121,6 @@ class RecordHandler {
|
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
123
|
|
|
126
|
-
_onPending(rec, value) {
|
|
127
|
-
if (value) {
|
|
128
|
-
this._stats.pending += 1
|
|
129
|
-
} else {
|
|
130
|
-
this._stats.pending -= 1
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (value) {
|
|
134
|
-
this._pending.set(rec, [])
|
|
135
|
-
} else {
|
|
136
|
-
for (const callback of this._pending.get(rec)) {
|
|
137
|
-
callback()
|
|
138
|
-
}
|
|
139
|
-
this._pending.delete(rec)
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
124
|
_onUpdating(rec, value) {
|
|
144
125
|
if (value) {
|
|
145
126
|
this._stats.updating += 1
|
package/src/record/record.js
CHANGED
|
@@ -21,10 +21,7 @@ class Record {
|
|
|
21
21
|
this._emitting = false
|
|
22
22
|
/** @type Map? */ this._updating = null
|
|
23
23
|
/** @type Array? */ this._patching = null
|
|
24
|
-
this._pending = false
|
|
25
24
|
this._subscribed = this._sendMsg1(C.ACTIONS.SUBSCRIBE, this._name)
|
|
26
|
-
|
|
27
|
-
this._onPending(true)
|
|
28
25
|
}
|
|
29
26
|
|
|
30
27
|
/** @type {string} */
|
|
@@ -270,10 +267,6 @@ class Record {
|
|
|
270
267
|
this._subscribed = false
|
|
271
268
|
}
|
|
272
269
|
|
|
273
|
-
if (!this._pending) {
|
|
274
|
-
this._onPending(true)
|
|
275
|
-
}
|
|
276
|
-
|
|
277
270
|
if (this._state > C.RECORD_STATE.CLIENT) {
|
|
278
271
|
this._state = C.RECORD_STATE.CLIENT
|
|
279
272
|
this._emitUpdate()
|
|
@@ -284,7 +277,6 @@ class Record {
|
|
|
284
277
|
invariant(!this._refs, 'must not have refs')
|
|
285
278
|
invariant(!this._patching, 'must not have patches')
|
|
286
279
|
invariant(!this._updating, 'must not have updates')
|
|
287
|
-
invariant(!this._pending, 'must not be pending')
|
|
288
280
|
|
|
289
281
|
if (this._subscribed) {
|
|
290
282
|
this._sendMsg1(C.ACTIONS.UNSUBSCRIBE, this._name)
|
|
@@ -364,10 +356,6 @@ class Record {
|
|
|
364
356
|
this._state = this._version.charAt(0) === 'I' ? C.RECORD_STATE.STALE : C.RECORD_STATE.SERVER
|
|
365
357
|
}
|
|
366
358
|
|
|
367
|
-
if (this._pending) {
|
|
368
|
-
this._onPending(false)
|
|
369
|
-
}
|
|
370
|
-
|
|
371
359
|
if (this._state !== prevState || this._data !== prevData || this._version !== prevVersion) {
|
|
372
360
|
this._emitUpdate()
|
|
373
361
|
}
|
|
@@ -401,18 +389,6 @@ class Record {
|
|
|
401
389
|
this._handler._onUpdating(this, value)
|
|
402
390
|
}
|
|
403
391
|
|
|
404
|
-
_onPending(value) {
|
|
405
|
-
if (value) {
|
|
406
|
-
this._pending = true
|
|
407
|
-
this.ref()
|
|
408
|
-
} else {
|
|
409
|
-
this._pending = false
|
|
410
|
-
this.unref()
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
this._handler._onPending(this, value)
|
|
414
|
-
}
|
|
415
|
-
|
|
416
392
|
_onSubscriptionHasProvider([, hasProvider]) {
|
|
417
393
|
if (this._state < C.RECORD_STATE.SERVER) {
|
|
418
394
|
return
|