Skip to content

Commit

Permalink
Deployed using Blazing fast GitHub Pages deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nin-jin committed Dec 5, 2023
1 parent f5f6962 commit 8294609
Show file tree
Hide file tree
Showing 12 changed files with 211 additions and 121 deletions.
30 changes: 17 additions & 13 deletions node.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,25 @@ declare namespace $.$$ {
declare namespace $ {
}

declare namespace $ {
let $mol_mem_persist: typeof $mol_wire_solid;
}

declare namespace $ {
export function $mol_wire_sync<Host extends object>(obj: Host): ObjectOrFunctionResultAwaited<Host>;
type FunctionResultAwaited<Some> = Some extends (...args: infer Args) => infer Res ? (...args: Args) => Awaited<Res> : Some;
type MethodsResultAwaited<Host extends Object> = {
[K in keyof Host]: FunctionResultAwaited<Host[K]>;
};
type ObjectOrFunctionResultAwaited<Some> = (Some extends (...args: any) => unknown ? FunctionResultAwaited<Some> : {}) & (Some extends Object ? MethodsResultAwaited<Some> : Some);
export {};
}

declare namespace $ {
class $mol_storage extends $mol_object2 {
static native(): any;
static persisted(next?: boolean): boolean;
static estimate(): number;
static native(): StorageManager;
static persisted(next?: boolean, cache?: 'cache'): boolean;
static estimate(): StorageEstimate;
static dir(): FileSystemDirectoryHandle;
}
}
Expand Down Expand Up @@ -1147,16 +1161,6 @@ declare namespace $ {
}
}

declare namespace $ {
export function $mol_wire_sync<Host extends object>(obj: Host): ObjectOrFunctionResultAwaited<Host>;
type FunctionResultAwaited<Some> = Some extends (...args: infer Args) => infer Res ? (...args: Args) => Awaited<Res> : Some;
type MethodsResultAwaited<Host extends Object> = {
[K in keyof Host]: FunctionResultAwaited<Host[K]>;
};
type ObjectOrFunctionResultAwaited<Some> = (Some extends (...args: any) => unknown ? FunctionResultAwaited<Some> : {}) & (Some extends Object ? MethodsResultAwaited<Some> : Some);
export {};
}

declare namespace $ {
let $mol_action: typeof $mol_wire_method;
}
Expand Down
2 changes: 1 addition & 1 deletion node.deps.json

Large diffs are not rendered by default.

89 changes: 57 additions & 32 deletions node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node.js.map

Large diffs are not rendered by default.

89 changes: 57 additions & 32 deletions node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3482,19 +3482,70 @@ var $;
;
"use strict";
var $;
(function ($) {
$.$mol_mem_persist = $mol_wire_solid;
})($ || ($ = {}));
//mol/mem/persist/persist.ts
;
"use strict";
var $;
(function ($) {
function $mol_wire_sync(obj) {
return new Proxy(obj, {
get(obj, field) {
const val = obj[field];
if (typeof val !== 'function')
return val;
const temp = $mol_wire_task.getter(val);
return function $mol_wire_sync(...args) {
const fiber = temp(obj, args);
return fiber.sync();
};
},
apply(obj, self, args) {
const temp = $mol_wire_task.getter(obj);
const fiber = temp(self, args);
return fiber.sync();
},
});
}
$.$mol_wire_sync = $mol_wire_sync;
})($ || ($ = {}));
//mol/wire/sync/sync.ts
;
"use strict";
var $;
(function ($) {
class $mol_storage extends $mol_object2 {
static native() {
return null;
return this.$.$mol_dom_context.navigator.storage ?? {
persisted: async () => false,
persist: async () => false,
estimate: async () => ({}),
getDirectory: async () => null,
};
}
static persisted(next) {
return false;
static persisted(next, cache) {
$mol_mem_persist();
if (cache)
return Boolean(next);
const native = this.native();
if (next && !$mol_mem_cached(() => this.persisted())) {
native.persist().then(actual => {
setTimeout(() => this.persisted(actual, 'cache'), 5000);
if (actual)
this.$.$mol_log3_rise({ place: `$mol_storage`, message: `Persist: Yes` });
else
this.$.$mol_log3_fail({ place: `$mol_storage`, message: `Persist: No` });
});
}
return next ?? $mol_wire_sync(native).persisted();
}
static estimate() {
return 0;
return $mol_wire_sync(this.native() ?? {}).estimate();
}
static dir() {
return null;
return $mol_wire_sync(this.native()).getDirectory();
}
}
__decorate([
Expand All @@ -3505,7 +3556,7 @@ var $;
], $mol_storage, "persisted", null);
$.$mol_storage = $mol_storage;
})($ || ($ = {}));
//mol/storage/storage.node.ts
//mol/storage/storage.ts
;
"use strict";
var $;
Expand Down Expand Up @@ -3923,32 +3974,6 @@ var $;
;
"use strict";
var $;
(function ($) {
function $mol_wire_sync(obj) {
return new Proxy(obj, {
get(obj, field) {
const val = obj[field];
if (typeof val !== 'function')
return val;
const temp = $mol_wire_task.getter(val);
return function $mol_wire_sync(...args) {
const fiber = temp(obj, args);
return fiber.sync();
};
},
apply(obj, self, args) {
const temp = $mol_wire_task.getter(obj);
const fiber = temp(self, args);
return fiber.sync();
},
});
}
$.$mol_wire_sync = $mol_wire_sync;
})($ || ($ = {}));
//mol/wire/sync/sync.ts
;
"use strict";
var $;
(function ($) {
$.$mol_action = $mol_wire_method;
})($ || ($ = {}));
Expand Down
89 changes: 57 additions & 32 deletions node.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8294609

Please sign in to comment.