@nxtedition/deepstream.io-client-js 23.3.0 → 23.3.2

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.3.0",
3
+ "version": "23.3.2",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -22,8 +22,6 @@ class Listener {
22
22
  data = value
23
23
  } else if (value && typeof value === 'object') {
24
24
  data = this._stringify(value)
25
- } else if (data == null) {
26
- data = null
27
25
  } else {
28
26
  throw new Error(`invalid value: ${value}`)
29
27
  }
@@ -73,15 +71,17 @@ class Listener {
73
71
  return
74
72
  }
75
73
 
76
- const value$ = this._callback(name)
74
+ let value$
75
+ try {
76
+ value$ = this._callback(name)
77
+ } catch (err) {
78
+ value$ = rxjs.throwError(() => err)
79
+ }
80
+
77
81
  if (value$) {
78
82
  const subscription = value$.pipe(this._pipe).subscribe({
79
83
  next: ({ data, hash }) => {
80
- if (data == null) {
81
- this._connection.sendMsg(this._topic, C.ACTIONS.LISTEN_REJECT, [this._pattern, name])
82
- } else {
83
- this._connection.sendMsg(this._topic, C.ACTIONS.UPDATE, [name, `INF-${hash}`, data])
84
- }
84
+ this._connection.sendMsg(this._topic, C.ACTIONS.UPDATE, [name, `INF-${hash}`, data])
85
85
  },
86
86
  error: (err) => {
87
87
  this._error(name, err)