Skip to content

Commit dc63874

Browse files
committed
ugly port of counters
1 parent 830c80e commit dc63874

File tree

1 file changed

+2
-1
lines changed
  • typescript/packages/lookslike-high-level/src/recipes

1 file changed

+2
-1
lines changed

typescript/packages/lookslike-high-level/src/recipes/counters.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ const renameHandler = handler<{ detail: { value: string } }, { counter: Counter
2323

2424
const removeHandler = handler<{}, { counter: Counter, counters: Counter[] }>(function ({ }, { counter, counters }) {
2525
console.log("removeHandler", counter, counters);
26-
const index = counters.findIndex(counter);
26+
// FIXME(ja): not having equality check on objects is a problem
27+
const index = counters.findIndex((i) => i.title === counter.title && i.count === counter.count);
2728
if (index !== -1) {
2829
counters.splice(index, 1);
2930
}

0 commit comments

Comments
 (0)