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

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.23",
3
+ "version": "23.4.24",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -393,11 +393,6 @@ class RecordHandler {
393
393
  let prevData = kEmpty
394
394
 
395
395
  const onUpdate = (record) => {
396
- if (signal?.aborted) {
397
- o.error(new utils.AbortError())
398
- return
399
- }
400
-
401
396
  if (state && record.state < state) {
402
397
  return
403
398
  }
@@ -443,8 +438,15 @@ class RecordHandler {
443
438
  onUpdate(record)
444
439
  }
445
440
 
441
+ const abort = () => {
442
+ o.error(new utils.AbortError())
443
+ }
444
+
445
+ signal?.addEventListener('abort', abort)
446
+
446
447
  return () => {
447
448
  record.unsubscribe(onUpdate).unref()
449
+ signal?.removeEventListener('abort', abort)
448
450
  }
449
451
  })
450
452
  }