@nxtedition/deepstream.io-client-js 23.4.21 → 23.4.23

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.23",
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,11 @@ 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
+ return
399
+ }
400
+
394
401
  if (state && record.state < state) {
395
402
  return
396
403
  }
@@ -436,15 +443,8 @@ class RecordHandler {
436
443
  onUpdate(record)
437
444
  }
438
445
 
439
- const abort = () => {
440
- o.error(new utils.AbortError())
441
- }
442
-
443
- signal?.addEventListener('abort', abort)
444
-
445
446
  return () => {
446
447
  record.unsubscribe(onUpdate).unref()
447
- signal?.removeEventListener('abort', abort)
448
448
  }
449
449
  })
450
450
  }