Skip to content

Commit 133fbdf

Browse files
committed
fix
1 parent 929240c commit 133fbdf

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

frameworks/keyed/cample/src/main.js

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,7 @@ const adjectives = [
2727
"expensive",
2828
"fancy",
2929
],
30-
colours = [
31-
"red",
32-
"yellow",
33-
"blue",
34-
"green",
35-
"pink",
36-
"brown",
37-
"purple",
38-
"brown",
39-
"white",
40-
"black",
41-
"orange",
42-
],
30+
colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"],
4331
nouns = [
4432
"table",
4533
"chair",
@@ -150,25 +138,29 @@ const mainComponent = component(
150138
},
151139
functions: {
152140
run: [
153-
(setData) => () => {
141+
(setData, event) => () => {
142+
event.stopPropagation();
154143
setData(() => buildData(1000));
155144
},
156145
"updateRows",
157146
],
158147
runLots: [
159-
(setData) => () => {
148+
(setData, event) => () => {
149+
event.stopPropagation();
160150
setData(() => buildData(10000));
161151
},
162152
"updateRows",
163153
],
164154
add: [
165-
(setData) => () => {
155+
(setData, event) => () => {
156+
event.stopPropagation();
166157
setData((d) => [...d, ...buildData(1000)]);
167158
},
168159
"updateRows",
169160
],
170161
update: [
171-
(setData) => () => {
162+
(setData, event) => () => {
163+
event.stopPropagation();
172164
setData((d) => {
173165
const value = d.slice();
174166
for (let i = 0; i < value.length; i += 10) {
@@ -181,13 +173,15 @@ const mainComponent = component(
181173
"updateRows",
182174
],
183175
clear: [
184-
(setData) => () => {
176+
(setData, event) => () => {
177+
event.stopPropagation();
185178
setData(() => []);
186179
},
187180
"updateRows",
188181
],
189182
swapRows: [
190-
(setData) => () => {
183+
(setData, event) => () => {
184+
event.stopPropagation();
191185
setData((d) => {
192186
const value = d.slice();
193187
const tmp = value[1];
@@ -207,13 +201,15 @@ const mainComponent = component(
207201
},
208202
functions: {
209203
setSelected: [
210-
(setData) => (id) => {
204+
(setData, event) => (id) => {
205+
event.stopPropagation();
211206
setData(() => id);
212207
},
213208
"updateSelected",
214209
],
215210
delete: [
216-
(setData) => (id) => {
211+
(setData, event) => (id) => {
212+
event.stopPropagation();
217213
setData((d) => {
218214
const idx = d.findIndex((d) => d.id === id);
219215
return [...d.slice(0, idx), ...d.slice(idx + 1)];

0 commit comments

Comments
 (0)