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 Jan 11, 2024
1 parent 4a8d54b commit 71f57af
Show file tree
Hide file tree
Showing 19 changed files with 411 additions and 6 deletions.
22 changes: 22 additions & 0 deletions node.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11405,6 +11405,28 @@ declare namespace $ {
}
}

declare namespace $ {
type $mol_type_immutable_deep<Val> = {
readonly [field in keyof Val]: $mol_type_immutable_deep<Val[field]>;
};
}

declare namespace $ {
type $mol_mutable_wrapper<Value> = {
(patch?: (next: $mol_type_immutable_deep<Value>) => $mol_type_immutable_deep<Value>): $mol_type_immutable_deep<Value>;
} & {
[Field in keyof Value]: $mol_mutable_wrapper<Value[Field]>;
};
function $mol_mutable<Value>(input: Value, update?: (next: Value) => Value): $mol_mutable_wrapper<Value>;
}

declare namespace $ {
class $mol_mutable_demo extends $mol_example_code {
code(next?: any): string;
aspects(): readonly any[];
}
}

declare namespace $ {
class $hyoo_marked_app extends $mol_book2 {
plugins(): readonly any[];
Expand Down
2 changes: 1 addition & 1 deletion node.deps.json

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions node.js
Original file line number Diff line number Diff line change
Expand Up @@ -48326,6 +48326,54 @@ var $;
//mol/map/yandex/demo/-view.tree/demo.view.tree.ts
;
"use strict";
//mol/type/immutable/deep/deep/deep.ts
;
"use strict";
var $;
(function ($) {
function $mol_mutable(input, update = next => input = next) {
let output = undefined;
const clone = Array.isArray(input)
? () => [...input]
: () => ({ ...input });
return new Proxy($mol_mutable, {
get: (Mut, field) => Mut(input[field], next => (output ?? (output = update(clone())))[field] = next),
set: () => false,
apply: (Mut, self, [patch]) => {
if (patch)
update(output = input = patch(input));
return output ?? input;
},
});
}
$.$mol_mutable = $mol_mutable;
})($ || ($ = {}));
//mol/mutable/mutable.ts
;
"use strict";
var $;
(function ($) {
class $mol_mutable_demo extends $mol_example_code {
code(next) {
if (next !== undefined)
return next;
return "const person = [{id: '10', name: 'Jhon'}, false]\n\nconst mut = $mol_mutable(person)\n\nmut[1].id(v => '42')\nmut[1].name(() => 'Dave') \nmut[2]((v) => !v)\n\nconst next = mut()";
}
aspects() {
return [
"Mutable",
"Array"
];
}
}
__decorate([
$mol_mem
], $mol_mutable_demo.prototype, "code", null);
$.$mol_mutable_demo = $mol_mutable_demo;
})($ || ($ = {}));
//mol/mutable/demo/-view.tree/demo.view.tree.ts
;
"use strict";
var $;
(function ($) {
class $hyoo_marked_app extends $mol_book2 {
Expand Down
2 changes: 1 addition & 1 deletion node.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions node.meta.tree
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
include \/mol/list/demo/table
include \/mol/list/demo/tree
include \/mol/map/yandex/demo
include \/mol/mutable/demo
include \/hyoo/marked/demo
include \/hyoo/harp/demo
- include \/mol/message/demo
Expand Down
48 changes: 48 additions & 0 deletions node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48326,6 +48326,54 @@ var $;
//mol/map/yandex/demo/-view.tree/demo.view.tree.ts
;
"use strict";
//mol/type/immutable/deep/deep/deep.ts
;
"use strict";
var $;
(function ($) {
function $mol_mutable(input, update = next => input = next) {
let output = undefined;
const clone = Array.isArray(input)
? () => [...input]
: () => ({ ...input });
return new Proxy($mol_mutable, {
get: (Mut, field) => Mut(input[field], next => (output ?? (output = update(clone())))[field] = next),
set: () => false,
apply: (Mut, self, [patch]) => {
if (patch)
update(output = input = patch(input));
return output ?? input;
},
});
}
$.$mol_mutable = $mol_mutable;
})($ || ($ = {}));
//mol/mutable/mutable.ts
;
"use strict";
var $;
(function ($) {
class $mol_mutable_demo extends $mol_example_code {
code(next) {
if (next !== undefined)
return next;
return "const person = [{id: '10', name: 'Jhon'}, false]\n\nconst mut = $mol_mutable(person)\n\nmut[1].id(v => '42')\nmut[1].name(() => 'Dave') \nmut[2]((v) => !v)\n\nconst next = mut()";
}
aspects() {
return [
"Mutable",
"Array"
];
}
}
__decorate([
$mol_mem
], $mol_mutable_demo.prototype, "code", null);
$.$mol_mutable_demo = $mol_mutable_demo;
})($ || ($ = {}));
//mol/mutable/demo/-view.tree/demo.view.tree.ts
;
"use strict";
var $;
(function ($) {
class $hyoo_marked_app extends $mol_book2 {
Expand Down
90 changes: 90 additions & 0 deletions node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48318,6 +48318,54 @@ var $;
//mol/map/yandex/demo/-view.tree/demo.view.tree.ts
;
"use strict";
//mol/type/immutable/deep/deep/deep.ts
;
"use strict";
var $;
(function ($) {
function $mol_mutable(input, update = next => input = next) {
let output = undefined;
const clone = Array.isArray(input)
? () => [...input]
: () => ({ ...input });
return new Proxy($mol_mutable, {
get: (Mut, field) => Mut(input[field], next => (output ?? (output = update(clone())))[field] = next),
set: () => false,
apply: (Mut, self, [patch]) => {
if (patch)
update(output = input = patch(input));
return output ?? input;
},
});
}
$.$mol_mutable = $mol_mutable;
})($ || ($ = {}));
//mol/mutable/mutable.ts
;
"use strict";
var $;
(function ($) {
class $mol_mutable_demo extends $mol_example_code {
code(next) {
if (next !== undefined)
return next;
return "const person = [{id: '10', name: 'Jhon'}, false]\n\nconst mut = $mol_mutable(person)\n\nmut[1].id(v => '42')\nmut[1].name(() => 'Dave') \nmut[2]((v) => !v)\n\nconst next = mut()";
}
aspects() {
return [
"Mutable",
"Array"
];
}
}
__decorate([
$mol_mem
], $mol_mutable_demo.prototype, "code", null);
$.$mol_mutable_demo = $mol_mutable_demo;
})($ || ($ = {}));
//mol/mutable/demo/-view.tree/demo.view.tree.ts
;
"use strict";
var $;
(function ($) {
class $hyoo_marked_app extends $mol_book2 {
Expand Down Expand Up @@ -63820,6 +63868,48 @@ var $;
//mol/unit/unit.test.ts
;
"use strict";
//mol/type/immutable/deep/deep/deep.test.ts
;
"use strict";
var $;
(function ($) {
$mol_test({
'Wrap & unwrap'() {
const val = [1];
const mut = $mol_mutable(val);
$mol_assert_equal(val, mut());
},
'Deep array'() {
const val = [[1], [2], [3]];
const mut = $mol_mutable(val);
$mol_assert_equal(mut[1][0](v => -v), -2);
$mol_assert_unique(val, mut());
$mol_assert_equal(val[0], mut()[0]);
$mol_assert_equal(val[2], mut()[2]);
$mol_assert_unique(val[1], mut()[1]);
$mol_assert_like(mut()[1], [-2]);
},
'Array insert'() {
const val = [[1, 2, 3, 4]];
const mut = $mol_mutable(val);
$mol_assert_like(mut[0](a => [...a.slice(0, 2), 7, ...a.slice(2)]), [1, 2, 7, 3, 4]);
$mol_assert_like(mut(), [[1, 2, 7, 3, 4]]);
},
'Deep objects'() {
const val = { a: { x: 1 }, b: { y: 2 }, c: { z: 3 } };
const mut = $mol_mutable(val);
$mol_assert_equal(mut.b.y(v => -v), -2);
$mol_assert_unique(val, mut());
$mol_assert_equal(val.a, mut().a);
$mol_assert_equal(val.c, mut().c);
$mol_assert_unique(val.b, mut().b);
$mol_assert_like(mut().b, { y: -2 });
},
});
})($ || ($ = {}));
//mol/mutable/mutable.test.ts
;
"use strict";
var $;
(function ($) {
function $hyoo_harp_to_string(query) {
Expand Down
2 changes: 1 addition & 1 deletion node.test.js.map

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions node.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -5865,6 +5865,21 @@ $mol_map_yandex_demo $mol_example_large
\Integration
\Widget/Map

$mol_mutable_demo $mol_example_code
code? \
\const person = [{id: '10', name: 'Jhon'}, false]
\
\const mut = $mol_mutable(person)
\
\mut[1].id(v => '42')
\mut[1].name(() => 'Dave')
\mut[2]((v) => !v)
\
\const next = mut()
aspects /
\Mutable
\Array

$hyoo_marked_app $mol_book2
plugins /
<= Theme $mol_theme_auto
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,11 @@
"$mol_geo",
"$mol_mem_force",
"$mol_fiber",
"$mol_mutable_demo",
"$mol_mutable",
"$mol_type_immutable_deep_deep",
"$mol_type_immutable_deep",
"$mol_type_immutable",
"$hyoo_marked_demo",
"$hyoo_marked_app",
"$hyoo_harp_demo",
Expand Down
22 changes: 22 additions & 0 deletions web.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11378,6 +11378,28 @@ declare namespace $ {
}
}

declare namespace $ {
type $mol_type_immutable_deep<Val> = {
readonly [field in keyof Val]: $mol_type_immutable_deep<Val[field]>;
};
}

declare namespace $ {
type $mol_mutable_wrapper<Value> = {
(patch?: (next: $mol_type_immutable_deep<Value>) => $mol_type_immutable_deep<Value>): $mol_type_immutable_deep<Value>;
} & {
[Field in keyof Value]: $mol_mutable_wrapper<Value[Field]>;
};
function $mol_mutable<Value>(input: Value, update?: (next: Value) => Value): $mol_mutable_wrapper<Value>;
}

declare namespace $ {
class $mol_mutable_demo extends $mol_example_code {
code(next?: any): string;
aspects(): readonly any[];
}
}

declare namespace $ {
class $hyoo_marked_app extends $mol_book2 {
plugins(): readonly any[];
Expand Down
2 changes: 1 addition & 1 deletion web.deps.json

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions web.js
Original file line number Diff line number Diff line change
Expand Up @@ -48257,6 +48257,54 @@ var $;
//mol/map/yandex/demo/-view.tree/demo.view.tree.ts
;
"use strict";
//mol/type/immutable/deep/deep/deep.ts
;
"use strict";
var $;
(function ($) {
function $mol_mutable(input, update = next => input = next) {
let output = undefined;
const clone = Array.isArray(input)
? () => [...input]
: () => ({ ...input });
return new Proxy($mol_mutable, {
get: (Mut, field) => Mut(input[field], next => (output ?? (output = update(clone())))[field] = next),
set: () => false,
apply: (Mut, self, [patch]) => {
if (patch)
update(output = input = patch(input));
return output ?? input;
},
});
}
$.$mol_mutable = $mol_mutable;
})($ || ($ = {}));
//mol/mutable/mutable.ts
;
"use strict";
var $;
(function ($) {
class $mol_mutable_demo extends $mol_example_code {
code(next) {
if (next !== undefined)
return next;
return "const person = [{id: '10', name: 'Jhon'}, false]\n\nconst mut = $mol_mutable(person)\n\nmut[1].id(v => '42')\nmut[1].name(() => 'Dave') \nmut[2]((v) => !v)\n\nconst next = mut()";
}
aspects() {
return [
"Mutable",
"Array"
];
}
}
__decorate([
$mol_mem
], $mol_mutable_demo.prototype, "code", null);
$.$mol_mutable_demo = $mol_mutable_demo;
})($ || ($ = {}));
//mol/mutable/demo/-view.tree/demo.view.tree.ts
;
"use strict";
var $;
(function ($) {
class $hyoo_marked_app extends $mol_book2 {
Expand Down
2 changes: 1 addition & 1 deletion web.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions web.meta.tree
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
include \/mol/list/demo/table
include \/mol/list/demo/tree
include \/mol/map/yandex/demo
include \/mol/mutable/demo
include \/hyoo/marked/demo
include \/hyoo/harp/demo
- include \/mol/message/demo
Expand Down
Loading

0 comments on commit 71f57af

Please sign in to comment.