Commit 51daedd
Extract counters API from global store into dedicated module (#2897)
This refactor moves the counters helpers out of
`frontend/app/store/global.ts` into a dedicated `counters.ts` module,
and updates existing call sites to import from the new location. The
goal is to keep `global.ts` focused on global store/state concerns while
preserving current counters behavior.
- **Module extraction**
- Added `frontend/app/store/counters.ts` containing:
- `counterInc(name, incAmt = 1)`
- `countersClear()`
- `countersPrint()`
- Moved logic unchanged from `global.ts`.
- **Global store cleanup**
- Removed counters state/functions from `frontend/app/store/global.ts`.
- Removed counters exports from `global.ts`’s export surface.
- **Call site updates**
- Updated imports to use `@/store/counters` in:
- `frontend/app/block/block.tsx` (`counterInc`)
- `frontend/wave.ts` (`countersClear`, `countersPrint`)
```ts
// before
import { counterInc } from "@/store/global";
// after
import { counterInc } from "@/store/counters";
```
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>1 parent 1840de4 commit 51daedd
File tree
4 files changed
+26
-25
lines changed- frontend
- app
- block
- store
4 files changed
+26
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | | - | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
740 | 739 | | |
741 | 740 | | |
742 | 741 | | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | 742 | | |
762 | 743 | | |
763 | 744 | | |
| |||
967 | 948 | | |
968 | 949 | | |
969 | 950 | | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | 951 | | |
974 | 952 | | |
975 | 953 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
0 commit comments