@xh/hoist 70.0.0-SNAPSHOT.1731374612473 → 70.0.0-SNAPSHOT.1731694945674
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 +4 -1
- package/build/types/promise/Promise.d.ts +6 -5
- package/data/cube/View.ts +6 -0
- package/package.json +1 -1
- package/promise/Promise.ts +6 -7
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -19,7 +19,10 @@
|
|
|
19
19
|
* `DashModel|GroupingChooserModel|FilterChooserModel|PanelModel|TabContainerModel.provider`
|
|
20
20
|
* `PersistenceProvider.clearRaw()`
|
|
21
21
|
* Renamed `ZoneGridModelPersistOptions.persistMappings`, adding the trailing `s` for consistency.
|
|
22
|
-
*
|
|
22
|
+
* Changed signature of `JsonBlobService.listAsync()` to inline `loadSpec` with all other args in a
|
|
23
|
+
single options object.
|
|
24
|
+
* Changed signature of `waitFor()` to take its optional `interval` and `timeout` arguments in a
|
|
25
|
+
single options object.
|
|
23
26
|
|
|
24
27
|
### 🎁 New Features
|
|
25
28
|
|
|
@@ -87,15 +87,16 @@ export type PromiseLinkSpec = TaskObserver | {
|
|
|
87
87
|
*/
|
|
88
88
|
export declare function wait<T>(interval?: number): Promise<T>;
|
|
89
89
|
/**
|
|
90
|
-
* Return a promise that will resolve after a condition has been met,
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* @param condition - function that should return true when condition is met
|
|
90
|
+
* Return a promise that will resolve after a condition has been met, or reject if timed out.
|
|
91
|
+
* @param condition - function returning true when expected condition is met.
|
|
94
92
|
* @param interval - milliseconds to wait between checks (default 50). Note that the actual time
|
|
95
93
|
* will be subject to the minimum delay for `setTimeout()` in the browser.
|
|
96
94
|
* @param timeout - milliseconds after which the Promise should be rejected (default 5000).
|
|
97
95
|
*/
|
|
98
|
-
export declare function waitFor(condition: () => boolean, interval
|
|
96
|
+
export declare function waitFor(condition: () => boolean, { interval, timeout }?: {
|
|
97
|
+
interval?: number;
|
|
98
|
+
timeout?: number;
|
|
99
|
+
}): Promise<void>;
|
|
99
100
|
/**
|
|
100
101
|
* Return a promise that resolves immediately.
|
|
101
102
|
* @param value - the value to be returned by the resulting Promise.
|
package/data/cube/View.ts
CHANGED
|
@@ -472,6 +472,12 @@ export class View extends HoistBase {
|
|
|
472
472
|
'Store.reuseRecords cannot be used on a Store that is connected to a Cube View'
|
|
473
473
|
);
|
|
474
474
|
|
|
475
|
+
throwIf(
|
|
476
|
+
ret.some(s => s.idEncodesTreePath) &&
|
|
477
|
+
(!isNil(this.cube.bucketSpecFn) || !isNil(this.cube.omitFn)),
|
|
478
|
+
'Store.idEncodesTreePath cannot be used on a Store that is connected to a Cube with a `bucketSpecFn` or `omitFn`'
|
|
479
|
+
);
|
|
480
|
+
|
|
475
481
|
return ret;
|
|
476
482
|
}
|
|
477
483
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "70.0.0-SNAPSHOT.
|
|
3
|
+
"version": "70.0.0-SNAPSHOT.1731694945674",
|
|
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",
|
package/promise/Promise.ts
CHANGED
|
@@ -121,21 +121,20 @@ export function wait<T>(interval: number = 0): Promise<T> {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* Return a promise that will resolve after a condition has been met,
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @param condition - function that should return true when condition is met
|
|
124
|
+
* Return a promise that will resolve after a condition has been met, or reject if timed out.
|
|
125
|
+
* @param condition - function returning true when expected condition is met.
|
|
128
126
|
* @param interval - milliseconds to wait between checks (default 50). Note that the actual time
|
|
129
127
|
* will be subject to the minimum delay for `setTimeout()` in the browser.
|
|
130
128
|
* @param timeout - milliseconds after which the Promise should be rejected (default 5000).
|
|
131
129
|
*/
|
|
132
130
|
export function waitFor(
|
|
133
131
|
condition: () => boolean,
|
|
134
|
-
interval: number =
|
|
135
|
-
timeout: number = 5 * SECONDS
|
|
132
|
+
{interval = 50, timeout = 5 * SECONDS}: {interval?: number; timeout?: number} = {}
|
|
136
133
|
): Promise<void> {
|
|
137
|
-
|
|
134
|
+
if (!isNumber(interval) || interval <= 0) throw new Error('Invalid interval');
|
|
135
|
+
if (!isNumber(timeout) || timeout <= 0) throw new Error('Invalid timeout');
|
|
138
136
|
|
|
137
|
+
const startTime = Date.now();
|
|
139
138
|
return new Promise((resolve, reject) => {
|
|
140
139
|
const resolveOnMet = () => {
|
|
141
140
|
if (condition()) {
|