Skip to content

Commit 0a41fe4

Browse files
committed
destam-dom: Send actual function pointers instead of an index into a list
1 parent e1e78b9 commit 0a41fe4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

frameworks/keyed/destam-dom/src/main.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ const App = () => {
5757
const dom =
5858
<tr class={selected.map(sel => sel === dom ? "danger": "")}>
5959
<td class='col-md-1' $textContent={ idCounter++ } />
60-
<td class='col-md-4'><a $clickHandler={1} $textContent={ label } /></td>
61-
<td class='col-md-1'><a $clickHandler={2}><span class='glyphicon glyphicon-remove' aria-hidden="true" /></a></td>
60+
<td class='col-md-4'><a $clickHandler={select} $textContent={ label } /></td>
61+
<td class='col-md-1'><a $clickHandler={remove}><span class='glyphicon glyphicon-remove' aria-hidden="true" /></a></td>
6262
<td class='col-md-6'/>
6363
</tr>;
6464

@@ -90,9 +90,7 @@ const App = () => {
9090
}
9191

9292
if (!handler) return;
93-
94-
let i = Array.prototype.indexOf.call(e.parentElement.children, e);
95-
[null, select, remove][handler](i);
93+
handler(Array.prototype.indexOf.call(e.parentElement.children, e));
9694
}}>
9795
{array}
9896
</tbody></table>

0 commit comments

Comments
 (0)