We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c59d09 commit bf9dc17Copy full SHA for bf9dc17
1 file changed
src/Graduations.tsx
@@ -1,11 +1,11 @@
1
+import { For } from 'solid-js';
2
+
3
import { ClockLine as Graduation } from '@/ClockLine';
4
import { rotate, seconds } from '@/common';
5
-// For not used because Graduations are static - minor optimization
-export const Graduations = () =>
6
- [...Array(seconds).keys()]
7
- .map<[boolean, number]>((index) => [index % 5 === 0, index])
8
- .map(([isHour, index]) => (
+export const Graduations = () => (
+ <For each={Array.from({ length: seconds }, (_, index) => index % 5 === 0)}>
+ {(isHour, index) => (
9
<Graduation
10
class={
11
isHour
@@ -14,6 +14,8 @@ export const Graduations = () =>
14
}
15
graduation
16
length={isHour ? 6 : 2.5}
17
- transform={rotate(index / seconds, 0)}
+ transform={rotate(index() / seconds, 0)}
18
/>
19
- ));
+ )}
20
+ </For>
21
+);
0 commit comments