Skip to content

Commit ad339d5

Browse files
committed
Merge branch 'antonmak1-master'
2 parents dc9e77f + 4faabb9 commit ad339d5

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

frameworks/keyed/cample/package-lock.json

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

frameworks/keyed/cample/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-framework-benchmark-cample",
3-
"version": "3.2.0-alpha.33",
3+
"version": "3.2.0-alpha.39",
44
"description": "cample demo",
55
"main": "dist/main.js",
66
"js-framework-benchmark": {
@@ -30,6 +30,6 @@
3030
"webpack-cli": "5.1.4"
3131
},
3232
"dependencies": {
33-
"cample": "3.2.0-alpha.33"
33+
"cample": "3.2.0-alpha.39"
3434
}
3535
}

frameworks/keyed/cample/src/main.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,10 @@ const mainComponent = component(
189189
swapRows: [
190190
(setData) => () => {
191191
setData((d) => {
192-
const value = d.slice();
193-
const tmp = value[1];
194-
value[1] = value[998];
195-
value[998] = tmp;
196-
return value;
192+
const tmp = d[1];
193+
d[1] = d[998];
194+
d[998] = tmp;
195+
return d;
197196
});
198197
},
199198
"updateRows",
@@ -215,8 +214,10 @@ const mainComponent = component(
215214
delete: [
216215
(setData) => (id) => {
217216
setData((d) => {
217+
const value = d.slice();
218218
const idx = d.findIndex((d) => d.id === id);
219-
return [...d.slice(0, idx), ...d.slice(idx + 1)];
219+
value.splice(idx, 1);
220+
return value;
220221
});
221222
},
222223
"updateRows",

0 commit comments

Comments
 (0)