Skip to content

Commit 5513040

Browse files
committed
Bump
1 parent e38ee97 commit 5513040

File tree

3 files changed

+48
-51
lines changed

3 files changed

+48
-51
lines changed

frameworks/keyed/michijs/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/keyed/michijs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
"devDependencies": {
3131
"@michijs/tsconfig": "0.0.4",
3232
"@michijs/dev-server": "0.7.24",
33-
"typescript": "5.6.3"
33+
"typescript": "5.7.2"
3434
},
3535
"dependencies": {
36-
"@michijs/michijs": "2.0.10"
36+
"@michijs/michijs": "2.1.0"
3737
}
3838
}

frameworks/keyed/michijs/src/index.tsx

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
import {
2-
type ObservableType,
3-
observePrimitiveValue,
2+
type PrimitiveObservableType,
3+
useObservePrimitive,
44
ProxiedArray,
55
create,
66
} from "@michijs/michijs";
77

88
interface Row {
9-
label: ObservableType<string>;
9+
label: PrimitiveObservableType<string>;
1010
id: number;
11-
selected: ObservableType<string | null>;
11+
selected: PrimitiveObservableType<string | null>;
1212
}
1313
const adjectives = [
14-
"pretty",
15-
"large",
16-
"big",
17-
"small",
18-
"tall",
19-
"short",
20-
"long",
21-
"handsome",
22-
"plain",
23-
"quaint",
24-
"clean",
25-
"elegant",
26-
"easy",
27-
"angry",
28-
"crazy",
29-
"helpful",
30-
"mushy",
31-
"odd",
32-
"unsightly",
33-
"adorable",
34-
"important",
35-
"inexpensive",
36-
"cheap",
37-
"expensive",
38-
"fancy",
39-
],
14+
"pretty",
15+
"large",
16+
"big",
17+
"small",
18+
"tall",
19+
"short",
20+
"long",
21+
"handsome",
22+
"plain",
23+
"quaint",
24+
"clean",
25+
"elegant",
26+
"easy",
27+
"angry",
28+
"crazy",
29+
"helpful",
30+
"mushy",
31+
"odd",
32+
"unsightly",
33+
"adorable",
34+
"important",
35+
"inexpensive",
36+
"cheap",
37+
"expensive",
38+
"fancy",
39+
],
4040
colours = [
4141
"red",
4242
"yellow",
@@ -73,23 +73,21 @@ const adjectives = [
7373
const data = new Array<Row>(count);
7474
for (let i = 0; i < count; i++)
7575
data[i] = {
76-
selected: observePrimitiveValue<string | null>(null),
76+
selected: useObservePrimitive<string | null>(null),
7777
id: nextId++,
78-
label: observePrimitiveValue(
78+
label: useObservePrimitive(
7979
`${adjectives[_random(adjectivesLength)]} ${colours[_random(coloursLength)]} ${nouns[_random(nounsLength)]}`,
8080
),
8181
};
8282
return data;
8383
},
84-
rows = new ProxiedArray<Row>([], undefined, true),
85-
run = () => rows.$replace(buildData()),
86-
runLots = () => rows.$replace(buildData(10000)),
84+
rows = new ProxiedArray<Row>(),
85+
run = () => rows.$replace(...buildData()),
86+
runLots = () => rows.$replace(...buildData(10000)),
8787
add = () => rows.push(...buildData()),
8888
update = () => {
89-
const array = rows.$value,
90-
length = array.length;
91-
for (let i = 0; i < length; i += 10) {
92-
const label = array[i].label;
89+
for (let i = 0; i < rows.length; i += 10) {
90+
const label = rows[i].label;
9391
label(`${label()} !!!`);
9492
}
9593
},
@@ -99,8 +97,7 @@ const adjectives = [
9997
if (selectedItem) selectedItem.selected(null);
10098
selectedItem = row;
10199
},
102-
deleteItem = (id: number) =>
103-
rows.$remove(rows.$value.findIndex((x) => x.id === id)),
100+
deleteItem = (id: number) => rows.$remove(rows.findIndex((x) => x.id === id)),
104101
swapRows = () => rows.$swap(1, 998);
105102

106103
let nextId = 1,

0 commit comments

Comments
 (0)