@shaxpir/duiduidui-models 1.5.4 → 1.5.5
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/dist/models/Model.js +5 -5
- package/package.json +1 -1
package/dist/models/Model.js
CHANGED
|
@@ -18,11 +18,6 @@ class Model {
|
|
|
18
18
|
model._isDisposed = false;
|
|
19
19
|
model._isForbidden = false;
|
|
20
20
|
model._hasEventListeners = false;
|
|
21
|
-
// When a model is newly created, or retrieved via a "fetch query", treat that as an implicit
|
|
22
|
-
// call to "acquire", since the SharedDB doc object will eventually need to be disposed.
|
|
23
|
-
if (shouldAcquire) {
|
|
24
|
-
this._acquireCount++;
|
|
25
|
-
}
|
|
26
21
|
const onBeforeOpBatch = function (op, source) {
|
|
27
22
|
if (model._shouldPerformModelChangeAnalysis) {
|
|
28
23
|
model._dataBeforeOpBatch = shaxpir_common_1.Struct.clone(model.doc.data);
|
|
@@ -62,6 +57,11 @@ class Model {
|
|
|
62
57
|
model._hasEventListeners = false;
|
|
63
58
|
}
|
|
64
59
|
};
|
|
60
|
+
if (shouldAcquire) {
|
|
61
|
+
this.acquire().catch((err) => {
|
|
62
|
+
console.error(`error during implicit acquire of model ${model.compoundKey}: ${err}`);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
65
|
}
|
|
66
66
|
get kind() {
|
|
67
67
|
// Defensive check in case doc isn't fully initialized
|