Initial commit

This commit is contained in:
jiapengyu
2026-07-27 13:37:48 +08:00
commit ecba71e2a5
39123 changed files with 5989154 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.signal = void 0;
const system_1 = require("./system");
const dep_1 = require("./dep");
function signal(oldValue) {
const dep = new dep_1.Dep();
const fn = (() => {
(0, system_1.track)(dep);
return oldValue;
});
fn.markDirty = () => {
(0, system_1.trigger)(dep, 3 /* DirtyLevels.Dirty */);
};
fn.set = (newValue) => {
if (!Object.is(oldValue, oldValue = newValue)) {
fn.markDirty();
}
};
return fn;
}
exports.signal = signal;