@azrico/webobject 1.5.1 → 1.5.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.
|
@@ -62,9 +62,8 @@ export declare class SimpleObject extends MapableObject {
|
|
|
62
62
|
* if the field is not in delta instantly calls the `apply` function to remove from delta
|
|
63
63
|
* @param key
|
|
64
64
|
* @param value
|
|
65
|
-
* @param shouldNotify
|
|
66
65
|
*/
|
|
67
|
-
setPreferApply(key: WriteablePropOf<this>, value: any
|
|
66
|
+
setPreferApply(key: WriteablePropOf<this>, value: any): Promise<boolean>;
|
|
68
67
|
/**
|
|
69
68
|
* set value and run the event handlers if needed
|
|
70
69
|
* @return true if changed , false otherwise
|
|
@@ -191,31 +191,26 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
191
191
|
* if the field is not in delta instantly calls the `apply` function to remove from delta
|
|
192
192
|
* @param key
|
|
193
193
|
* @param value
|
|
194
|
-
* @param shouldNotify
|
|
195
194
|
*/
|
|
196
195
|
)
|
|
197
196
|
}, {
|
|
198
197
|
key: "setPreferApply",
|
|
199
198
|
value: (function () {
|
|
200
199
|
var _setPreferApply = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(key, value) {
|
|
201
|
-
var
|
|
202
|
-
keyExists,
|
|
203
|
-
res,
|
|
204
|
-
_args2 = arguments;
|
|
200
|
+
var keyExists, res;
|
|
205
201
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
206
202
|
while (1) switch (_context2.prev = _context2.next) {
|
|
207
203
|
case 0:
|
|
208
|
-
shouldNotify = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : "auto";
|
|
209
204
|
keyExists = key in this.__delta;
|
|
210
|
-
_context2.next =
|
|
211
|
-
return this.set(key, value,
|
|
212
|
-
case
|
|
205
|
+
_context2.next = 3;
|
|
206
|
+
return this.set(key, value, keyExists ? "auto" : false);
|
|
207
|
+
case 3:
|
|
213
208
|
res = _context2.sent;
|
|
214
209
|
if (!keyExists) {
|
|
215
210
|
this.apply(key);
|
|
216
211
|
}
|
|
217
212
|
return _context2.abrupt("return", res);
|
|
218
|
-
case
|
|
213
|
+
case 6:
|
|
219
214
|
case "end":
|
|
220
215
|
return _context2.stop();
|
|
221
216
|
}
|