@nxtedition/deepstream.io-client-js 24.1.14 → 24.1.16
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 +1 -1
- package/src/record/record.js +5 -4
package/package.json
CHANGED
package/src/record/record.js
CHANGED
|
@@ -236,7 +236,7 @@ class Record {
|
|
|
236
236
|
signal?.throwIfAborted()
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
update(
|
|
239
|
+
update(...args) {
|
|
240
240
|
invariant(this._refs > 0, 'missing refs')
|
|
241
241
|
|
|
242
242
|
if (this._version.charAt(0) === 'I') {
|
|
@@ -248,8 +248,9 @@ class Record {
|
|
|
248
248
|
return Promise.resolve()
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
const
|
|
252
|
-
const
|
|
251
|
+
const options = args.at(-1) === 'object' ? args.pop() : null
|
|
252
|
+
const path = args.length === 1 ? undefined : args[0]
|
|
253
|
+
const updater = args.length === 1 ? args[0] : args[1]
|
|
253
254
|
|
|
254
255
|
if (typeof updater !== 'function') {
|
|
255
256
|
throw new Error('invalid argument: updater')
|
|
@@ -264,7 +265,7 @@ class Record {
|
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
this.ref()
|
|
267
|
-
return this.when(C.RECORD_STATE.SERVER)
|
|
268
|
+
return this.when(C.RECORD_STATE.SERVER, options)
|
|
268
269
|
.then(() => {
|
|
269
270
|
const prev = this.get(path)
|
|
270
271
|
const next = updater(prev, this._version)
|