@xh/hoist 73.0.0-SNAPSHOT.1746740884592 → 73.0.0-SNAPSHOT.1746798376611
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/CHANGELOG.md +1 -0
- package/core/HoistBaseDecorators.ts +9 -2
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
* Fixed drag-and-drop usability issues with the mobile `ColChooser`.
|
|
37
37
|
* Made `GridModel.defaultGroupSortFn` null-safe and improved type signature.
|
|
38
38
|
* Disable `dashCanvasAddViewButton` if there are no `menuItems` to show.
|
|
39
|
+
* Fixed `@persist` decorator.
|
|
39
40
|
|
|
40
41
|
### ⚙️ Typescript API Adjustments
|
|
41
42
|
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
|
+
import {wait} from '@xh/hoist/promise';
|
|
8
|
+
import {observable} from 'mobx';
|
|
7
9
|
import {logError, throwIf} from '../utils/js';
|
|
8
10
|
import {HoistBaseClass, PersistableState, PersistenceProvider, PersistOptions} from './';
|
|
9
11
|
|
|
@@ -71,7 +73,9 @@ function createPersistDescriptor(
|
|
|
71
73
|
);
|
|
72
74
|
return descriptor;
|
|
73
75
|
}
|
|
74
|
-
const codeValue = descriptor.initializer
|
|
76
|
+
const codeValue = descriptor.initializer,
|
|
77
|
+
// True once the property is available on the instance (after other decorators have run).
|
|
78
|
+
propertyAvailable = observable.box(false);
|
|
75
79
|
let hasInitialized = false,
|
|
76
80
|
ret;
|
|
77
81
|
const initializer = function () {
|
|
@@ -90,7 +94,7 @@ function createPersistDescriptor(
|
|
|
90
94
|
owner: this,
|
|
91
95
|
target: {
|
|
92
96
|
getPersistableState: () =>
|
|
93
|
-
new PersistableState(
|
|
97
|
+
new PersistableState(propertyAvailable.get() ? this[property] : ret),
|
|
94
98
|
setPersistableState: state => {
|
|
95
99
|
if (!hasInitialized) {
|
|
96
100
|
ret = state.value;
|
|
@@ -101,6 +105,9 @@ function createPersistDescriptor(
|
|
|
101
105
|
}
|
|
102
106
|
});
|
|
103
107
|
|
|
108
|
+
// Wait for next tick to ensure property is available on the instance before observing.
|
|
109
|
+
wait().then(() => propertyAvailable.set(true));
|
|
110
|
+
|
|
104
111
|
hasInitialized = true;
|
|
105
112
|
return ret;
|
|
106
113
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "73.0.0-SNAPSHOT.
|
|
3
|
+
"version": "73.0.0-SNAPSHOT.1746798376611",
|
|
4
4
|
"description": "Hoist add-on for building and deploying React Applications.",
|
|
5
5
|
"repository": "github:xh/hoist-react",
|
|
6
6
|
"homepage": "https://xh.io",
|