Skip to content

Commit bf9dc17

Browse files
authored
feat: returned For in Graduations (#275)
1 parent 5c59d09 commit bf9dc17

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/Graduations.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import { For } from 'solid-js';
2+
13
import { ClockLine as Graduation } from '@/ClockLine';
24
import { rotate, seconds } from '@/common';
35

4-
// For not used because Graduations are static - minor optimization
5-
export const Graduations = () =>
6-
[...Array(seconds).keys()]
7-
.map<[boolean, number]>((index) => [index % 5 === 0, index])
8-
.map(([isHour, index]) => (
6+
export const Graduations = () => (
7+
<For each={Array.from({ length: seconds }, (_, index) => index % 5 === 0)}>
8+
{(isHour, index) => (
99
<Graduation
1010
class={
1111
isHour
@@ -14,6 +14,8 @@ export const Graduations = () =>
1414
}
1515
graduation
1616
length={isHour ? 6 : 2.5}
17-
transform={rotate(index / seconds, 0)}
17+
transform={rotate(index() / seconds, 0)}
1818
/>
19-
));
19+
)}
20+
</For>
21+
);

0 commit comments

Comments
 (0)