Skip to content

Commit 0cd1fe2

Browse files
committed
optimize preact signals
1 parent 3b17881 commit 0cd1fe2

File tree

1 file changed

+15
-25
lines changed
  • frameworks/keyed/preact-signals/src

1 file changed

+15
-25
lines changed

frameworks/keyed/preact-signals/src/main.jsx

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,8 @@ const run = () => {
123123
select = (id) => {
124124
selected.value = id;
125125
};
126-
127-
const App = () => {
128126

127+
const App = () => {
129128
return (
130129
<div class="container">
131130
<div class="jumbotron">
@@ -147,29 +146,20 @@ const App = () => {
147146
</div>
148147
<table class="table table-hover table-striped test-data">
149148
<tbody>
150-
{data.value.map((row) => {
151-
let rowId = row.id;
152-
return (
153-
<tr key={rowId} class={selected.value === rowId ? "danger" : ""}>
154-
<td class="col-md-1" textContent={rowId} />
155-
<td class="col-md-4">
156-
<a
157-
onClick={() => select(rowId)}
158-
textContent={row.label.value}
159-
/>
160-
</td>
161-
<td class="col-md-1">
162-
<a onClick={() => remove(rowId)}>
163-
<span
164-
class="glyphicon glyphicon-remove"
165-
aria-hidden="true"
166-
/>
167-
</a>
168-
</td>
169-
<td class="col-md-6" />
170-
</tr>
171-
);
172-
})}
149+
{data.value.map((row) => (
150+
<tr key={row.id} class={selected.value === row.id ? "danger" : ""}>
151+
<td class="col-md-1" textContent={row.id} />
152+
<td class="col-md-4">
153+
<a onClick={() => select(row.id)} textContent={row.label} />
154+
</td>
155+
<td class="col-md-1">
156+
<a onClick={() => remove(row.id)}>
157+
<span class="glyphicon glyphicon-remove" aria-hidden="true" />
158+
</a>
159+
</td>
160+
<td class="col-md-6" />
161+
</tr>
162+
))}
173163
</tbody>
174164
</table>
175165
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true" />

0 commit comments

Comments
 (0)