Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2bc0b4c

Browse files
committed
Merge branch 'master' of github.com:krausest/js-framework-benchmark
2 parents 29df338 + 55653d7 commit 2bc0b4c

File tree

6 files changed

+38
-33
lines changed

6 files changed

+38
-33
lines changed

frameworks/keyed/sinuous/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"url": "https://github.com/krausest/js-framework-benchmark.git"
1818
},
1919
"dependencies": {
20-
"sinuous": "0.8.1"
20+
"sinuous": "0.9.0"
2121
},
2222
"devDependencies": {
2323
"@babel/core": "7.4.4",

frameworks/keyed/sinuous/src/main.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,26 @@ const App = () => {
3333
const run = () => data(buildData(1000)) && selected(null);
3434
const runLots = () => data(buildData(10000)) && selected(null);
3535
const add = () => data(data().concat(buildData(1000)));
36+
const clear = () => data([]) && selected(null);
37+
const removeOrSelect = (e) => e.target.matches('.remove') ? remove(e) : select(e);
38+
const select = (e) => selected(getParentId(e.target));
39+
40+
let rowObject;
41+
const selected = (id) => {
42+
if (rowObject) rowObject.selected = '';
43+
const d = data();
44+
if (id && (rowObject = d.find(d => d.id === id))) {
45+
rowObject.selected = 'danger';
46+
}
47+
};
48+
3649
const update = () => {
3750
const d = data();
3851
for (let i = 0; i < d.length; i += 10) {
3952
d[i].label += ' !!!';
4053
}
4154
};
55+
4256
const swapRows = () => {
4357
const d = data();
4458
if (d.length > 998) {
@@ -48,16 +62,7 @@ const App = () => {
4862
data(d);
4963
}
5064
};
51-
const clear = () => data([]) && selected(null);
52-
const removeOrSelect = (e) => e.target.matches('.remove') ? remove(e) : select(e);
53-
const select = (e) => selected(getParentId(e.target));
54-
const selected = ((tr) => (id) => {
55-
if (tr) tr.selected = '';
56-
const d = data();
57-
if (id && (tr = d.find(d => d.id === id))) {
58-
tr.selected = 'danger';
59-
}
60-
})();
65+
6166
const remove = (e) => {
6267
const d = data();
6368
const idx = d.findIndex(d => d.id === getParentId(e.target));

index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)