()
| 1 | import { createSignal } from "npm:solid-js"; |
| 2 | |
| 3 | export function Counter() { |
| 4 | const [count, setCount] = createSignal(0); |
| 5 | |
| 6 | return ( |
| 7 | <view |
| 8 | style={{ |
| 9 | flexDirection: "row", |
| 10 | gap: 15, |
| 11 | alignItems: "center", |
| 12 | }} |
| 13 | > |
| 14 | <button |
| 15 | onClick={() => setCount(Math.max(count() - 1, 0))} |
| 16 | style={{ |
| 17 | borderRadius: 5, |
| 18 | padding: 10, |
| 19 | fontSize: 20, |
| 20 | }} |
| 21 | bezelStyle={NSBezelStyle.TexturedSquare} |
| 22 | > |
| 23 | - |
| 24 | </button> |
| 25 | |
| 26 | <text |
| 27 | style={{ |
| 28 | fontSize: 24, |
| 29 | }} |
| 30 | > |
| 31 | {count()} |
| 32 | </text> |
| 33 | |
| 34 | <button |
| 35 | onClick={() => setCount(count() + 1)} |
| 36 | style={{ |
| 37 | borderRadius: 5, |
| 38 | padding: 10, |
| 39 | fontSize: 20, |
| 40 | }} |
| 41 | bezelStyle={NSBezelStyle.TexturedSquare} |
| 42 | > |
| 43 | + |
| 44 | </button> |
| 45 | </view> |
| 46 | ); |
| 47 | } |
nothing calls this directly
no outgoing calls
no test coverage detected