@xh/hoist 73.0.0-SNAPSHOT.1745589992773 → 73.0.0-SNAPSHOT.1745689122610

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "73.0.0-SNAPSHOT.1745589992773",
3
+ "version": "73.0.0-SNAPSHOT.1745689122610",
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",
@@ -12,13 +12,11 @@ import {
12
12
  TrackOptions,
13
13
  XH,
14
14
  Some,
15
- Awaitable,
16
- TimeoutExceptionConfig
15
+ Awaitable
17
16
  } from '@xh/hoist/core';
18
17
  import {action} from '@xh/hoist/mobx';
19
18
  import {olderThan, SECONDS} from '@xh/hoist/utils/datetime';
20
19
  import {castArray, isFunction, isNumber, isString} from 'lodash';
21
- import {isOmitted} from '@xh/hoist/utils/impl';
22
20
 
23
21
  /**
24
22
  * Enhancements to the Global Promise object.
@@ -241,10 +239,9 @@ const enhancePromise = promisePrototype => {
241
239
  return this.finally(() => wait(interval));
242
240
  },
243
241
 
244
- timeout<T>(spec: PromiseTimeoutSpec): Promise<T> {
245
- if (spec == null) return this;
246
-
247
- const config: TimeoutExceptionConfig = isNumber(spec) ? {interval: spec} : spec;
242
+ timeout(config) {
243
+ if (config == null) return this;
244
+ if (isNumber(config)) config = {interval: config};
248
245
  const interval = config.interval;
249
246
 
250
247
  let completed = false;
@@ -259,14 +256,14 @@ const enhancePromise = promisePrototype => {
259
256
  return Promise.race([deadline, promise]);
260
257
  },
261
258
 
262
- linkTo<T>(cfg: PromiseLinkSpec): Promise<T> {
259
+ linkTo(cfg) {
263
260
  if (!cfg) return this;
264
261
 
265
- if (cfg instanceof TaskObserver) {
262
+ if (cfg.isTaskObserver) {
266
263
  cfg = {observer: cfg};
267
264
  }
268
265
 
269
- if (cfg.observer && !isOmitted(cfg)) {
266
+ if (cfg.observer && !(isFunction(cfg.omit) ? cfg.omit() : cfg.omit)) {
270
267
  cfg.observer.linkTo(TaskObserver.forPromise({promise: this, message: cfg.message}));
271
268
  }
272
269
  return this;