@nxtedition/deepstream.io-client-js 23.4.34 → 23.4.36

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/deepstream.io-client-js",
3
- "version": "23.4.34",
3
+ "version": "23.4.36",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -56,7 +56,7 @@ class RecordHandler {
56
56
 
57
57
  this._pruning = new Set()
58
58
  for (const rec of prune) {
59
- invariant(!rec.pending && !rec.ref, 'cannot prune pending or referenced record')
59
+ invariant(!rec.pending && !rec.refs, 'cannot prune pending or referenced record')
60
60
  rec._unsubscribe()
61
61
  this._records.delete(rec.name)
62
62
  this._stats.destroyed++
@@ -124,7 +124,7 @@ class RecordHandler {
124
124
  if (!record) {
125
125
  record = new Record(name, this)
126
126
  this._records.set(name, record)
127
- this._stats.destroyed--
127
+ this._stats.created++
128
128
  } else {
129
129
  record.ref()
130
130
  }
@@ -178,6 +178,9 @@ class RecordHandler {
178
178
  let timeoutHandle
179
179
 
180
180
  const records = [...this._pending]
181
+ for (const rec of records) {
182
+ rec.ref()
183
+ }
181
184
 
182
185
  const onDone = (val) => {
183
186
  if (done) {
@@ -233,10 +236,6 @@ class RecordHandler {
233
236
  }
234
237
  }
235
238
 
236
- for (const rec of records) {
237
- rec.ref()
238
- }
239
-
240
239
  if (timeoutValue) {
241
240
  timeoutHandle = timers.setTimeout(onTimeout, timeoutValue)
242
241
  }