@nxtedition/deepstream.io-client-js 23.4.21 → 23.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/deepstream.io-client-js",
3
- "version": "23.4.21",
3
+ "version": "23.4.22",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -345,7 +345,9 @@ class RecordHandler {
345
345
  if (idx < args.length && (args[idx] == null || typeof args[idx] === 'object')) {
346
346
  const options = args[idx++] || {}
347
347
 
348
- signal = options.signal
348
+ if (options.signal != null) {
349
+ signal = options.signal
350
+ }
349
351
 
350
352
  if (options.timeout != null) {
351
353
  timeoutValue = options.timeout
@@ -391,6 +393,10 @@ class RecordHandler {
391
393
  let prevData = kEmpty
392
394
 
393
395
  const onUpdate = (record) => {
396
+ if (signal?.aborted) {
397
+ o.error(new utils.AbortError())
398
+ }
399
+
394
400
  if (state && record.state < state) {
395
401
  return
396
402
  }
@@ -436,15 +442,8 @@ class RecordHandler {
436
442
  onUpdate(record)
437
443
  }
438
444
 
439
- const abort = () => {
440
- o.error(new utils.AbortError())
441
- }
442
-
443
- signal?.addEventListener('abort', abort)
444
-
445
445
  return () => {
446
446
  record.unsubscribe(onUpdate).unref()
447
- signal?.removeEventListener('abort', abort)
448
447
  }
449
448
  })
450
449
  }