@nxtedition/deepstream.io-client-js 23.4.7 → 23.4.9

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.7",
3
+ "version": "23.4.9",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -60,37 +60,46 @@ class Listener {
60
60
  }
61
61
 
62
62
  if (value$) {
63
- const subscription = value$.subscribe({
64
- next: (value) => {
65
- let data
66
- if (value && typeof value === 'string') {
67
- if (value.charAt(0) !== '{' && value.charAt(0) !== '[') {
63
+ const subscription = value$
64
+ .pipe(
65
+ rxjs.map((value) => {
66
+ let data
67
+ if (value && typeof value === 'string') {
68
+ if (value.charAt(0) !== '{' && value.charAt(0) !== '[') {
69
+ throw new Error(`invalid value: ${value}`)
70
+ }
71
+ data = value
72
+ } else if (value && typeof value === 'object') {
73
+ data = this._stringify(value)
74
+ } else {
68
75
  throw new Error(`invalid value: ${value}`)
69
76
  }
70
- data = value
71
- } else if (value && typeof value === 'object') {
72
- data = this._stringify(value)
73
- } else {
74
- throw new Error(`invalid value: ${value}`)
75
- }
76
-
77
- if (data === this._data) {
78
- return
79
- }
80
-
81
- this._data = data
82
- this._version = `INF-${this._connection.hasher.h64ToString(data)}`
83
- this._connection.sendMsg(this._topic, C.ACTIONS.UPDATE, [
84
- name,
85
- this._version,
86
- this._data,
87
- ])
88
- },
89
- error: (err) => {
90
- this._error(name, err)
91
- this._connection.sendMsg(this._topic, C.ACTIONS.LISTEN_REJECT, [this._pattern, name])
92
- },
93
- })
77
+
78
+ return data
79
+ })
80
+ )
81
+ .subscribe({
82
+ next: (data) => {
83
+ if (data === this._data) {
84
+ return
85
+ }
86
+
87
+ this._data = data
88
+ this._version = `INF-${this._connection.hasher.h64ToString(data)}`
89
+ this._connection.sendMsg(this._topic, C.ACTIONS.UPDATE, [
90
+ name,
91
+ this._version,
92
+ this._data,
93
+ ])
94
+ },
95
+ error: (err) => {
96
+ this._error(name, err)
97
+ this._connection.sendMsg(this._topic, C.ACTIONS.LISTEN_REJECT, [this._pattern, name])
98
+ },
99
+ complete: () => {
100
+ this._connection.sendMsg(this._topic, C.ACTIONS.LISTEN_REJECT, [this._pattern, name])
101
+ },
102
+ })
94
103
  this._subscriptions.set(name, subscription)
95
104
  } else {
96
105
  this._connection.sendMsg(this._topic, C.ACTIONS.LISTEN_REJECT, [this._pattern, name])