hyoo_sync_client 0.0.637 → 0.0.638

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/web.js CHANGED
@@ -3058,28 +3058,31 @@ var $;
3058
3058
  "use strict";
3059
3059
  var $;
3060
3060
  (function ($) {
3061
- /** State of time moment */
3062
- class $mol_state_time extends $mol_object {
3063
- static task(precision, reset) {
3064
- if (precision) {
3065
- return new $mol_after_timeout(precision, () => this.task(precision, null));
3066
- }
3067
- else {
3068
- return new $mol_after_frame(() => this.task(precision, null));
3069
- }
3070
- }
3071
- static now(precision) {
3072
- this.task(precision);
3073
- return Date.now();
3074
- }
3061
+ /** Convert a pseudo-synchronous (Suspense API) API to an explicit asynchronous one (for integrating with external systems). */
3062
+ function $mol_wire_async(obj) {
3063
+ let fiber;
3064
+ const temp = $mol_wire_task.getter(obj);
3065
+ return new Proxy(obj, {
3066
+ get(obj, field) {
3067
+ const val = obj[field];
3068
+ if (typeof val !== 'function')
3069
+ return val;
3070
+ let fiber;
3071
+ const temp = $mol_wire_task.getter(val);
3072
+ return function $mol_wire_async(...args) {
3073
+ fiber?.destructor();
3074
+ fiber = temp(obj, args);
3075
+ return fiber.async();
3076
+ };
3077
+ },
3078
+ apply(obj, self, args) {
3079
+ fiber?.destructor();
3080
+ fiber = temp(self, args);
3081
+ return fiber.async();
3082
+ },
3083
+ });
3075
3084
  }
3076
- __decorate([
3077
- $mol_mem_key
3078
- ], $mol_state_time, "task", null);
3079
- __decorate([
3080
- $mol_mem_key
3081
- ], $mol_state_time, "now", null);
3082
- $.$mol_state_time = $mol_state_time;
3085
+ $.$mol_wire_async = $mol_wire_async;
3083
3086
  })($ || ($ = {}));
3084
3087
 
3085
3088
  ;
@@ -3113,18 +3116,9 @@ var $;
3113
3116
  }
3114
3117
  return next ?? $mol_wire_sync(native).persisted();
3115
3118
  }
3116
- static estimate() {
3117
- $mol_state_time.now(1000);
3118
- try {
3119
- return $mol_wire_sync(this.native() ?? {}).estimate();
3120
- }
3121
- catch (error) {
3122
- $mol_fail_log(error);
3123
- return {
3124
- usage: 0,
3125
- quota: 0,
3126
- };
3127
- }
3119
+ static estimate(next) {
3120
+ new this.$.$mol_after_timeout(1000, $mol_wire_async(() => this.estimate(null)));
3121
+ return $mol_wire_sync(this.native() ?? {}).estimate();
3128
3122
  }
3129
3123
  static total() {
3130
3124
  return this.estimate().quota ?? 0;
@@ -4400,37 +4394,6 @@ var $;
4400
4394
  ];
4401
4395
  })($ || ($ = {}));
4402
4396
 
4403
- ;
4404
- "use strict";
4405
- var $;
4406
- (function ($) {
4407
- /** Convert a pseudo-synchronous (Suspense API) API to an explicit asynchronous one (for integrating with external systems). */
4408
- function $mol_wire_async(obj) {
4409
- let fiber;
4410
- const temp = $mol_wire_task.getter(obj);
4411
- return new Proxy(obj, {
4412
- get(obj, field) {
4413
- const val = obj[field];
4414
- if (typeof val !== 'function')
4415
- return val;
4416
- let fiber;
4417
- const temp = $mol_wire_task.getter(val);
4418
- return function $mol_wire_async(...args) {
4419
- fiber?.destructor();
4420
- fiber = temp(obj, args);
4421
- return fiber.async();
4422
- };
4423
- },
4424
- apply(obj, self, args) {
4425
- fiber?.destructor();
4426
- fiber = temp(self, args);
4427
- return fiber.async();
4428
- },
4429
- });
4430
- }
4431
- $.$mol_wire_async = $mol_wire_async;
4432
- })($ || ($ = {}));
4433
-
4434
4397
  ;
4435
4398
  "use strict";
4436
4399
  var $;