element-vir 25.4.4 → 25.6.0

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.
@@ -26,6 +26,8 @@ export declare class InternalAsyncPropClass<Value, Params> extends CallbackObser
26
26
  * `undefined` if it has not.
27
27
  */
28
28
  get settledValue(): Exclude<typeof this.value, Promise<any>> | undefined;
29
+ /** The current `.value` as a promise or resolved value. If `.value` is an error, it'll throw. */
30
+ get promiseValue(): Promise<Value>;
29
31
  /** The state of the current `.value`. */
30
32
  get state(): AsyncValueState;
31
33
  /**
@@ -32,6 +32,18 @@ export class InternalAsyncPropClass extends CallbackObservable {
32
32
  return undefined;
33
33
  }
34
34
  }
35
+ /** The current `.value` as a promise or resolved value. If `.value` is an error, it'll throw. */
36
+ get promiseValue() {
37
+ if (this.isError()) {
38
+ return Promise.reject(this.value);
39
+ }
40
+ else if (this.isWaiting()) {
41
+ return this.value;
42
+ }
43
+ else {
44
+ return Promise.resolve(this.value);
45
+ }
46
+ }
35
47
  /** The state of the current `.value`. */
36
48
  get state() {
37
49
  if (this.isResolved()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "element-vir",
3
- "version": "25.4.4",
3
+ "version": "25.6.0",
4
4
  "keywords": [
5
5
  "custom",
6
6
  "web",