Performance impruved

This commit is contained in:
Abdussamed 2023-06-18 15:25:43 +03:00
parent 731574be96
commit 13b2ac413f
3 changed files with 2346 additions and 9 deletions

2302
data.json Normal file

File diff suppressed because it is too large Load Diff

21
index.html Normal file
View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="./wire.js"></script>
<script>
let yup = é([]);
fetch("data.json")
.then(e => e.json())
.then(kkk => {
debugger;
yup.set(kkk);
});
</script>
</body>
</html>

14
wire.js
View File

@ -83,6 +83,19 @@
switch(typeof a) switch(typeof a)
{ {
case "object":{ case "object":{
if(Array.isArray(a))
{
let k = [...a];
for (let name = 0; name < k.length; name++) {
let value = k[name];
if(typeof value == "object")
{
k[name]=é.freeze(value);
}
};
Object.freeze(k);
return k;
}else{
let k = Object.assign({}, a); let k = Object.assign({}, a);
for (const [name, value] of Object.entries(k)) { for (const [name, value] of Object.entries(k)) {
if(typeof value == "object") if(typeof value == "object")
@ -93,6 +106,7 @@
Object.freeze(k); Object.freeze(k);
return k; return k;
} }
}
default: return a; default: return a;
}; };
}; };