From 3574324596c0c1bcd801c0bd9f96f25f24ad9b41 Mon Sep 17 00:00:00 2001 From: koumura Date: Thu, 1 Aug 2024 16:47:14 +0900 Subject: [PATCH] fix: TODO comment --- src/components/Button/index.tsx | 1 + src/hooks/usePopulate.ts | 2 ++ src/hooks/usePref.ts | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index e91c15c..9e97bf4 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -9,6 +9,7 @@ export const Button = ({ setSelected: Dispatch> }) => { // ボタンが選択されているかどうかの状態 を管理するフック + // TODO: これ不要そう? const [isChecked, setIsChecked] = useState(false) // ボタンがクリックされたときのハンドラー diff --git a/src/hooks/usePopulate.ts b/src/hooks/usePopulate.ts index 8b29a45..9869e77 100644 --- a/src/hooks/usePopulate.ts +++ b/src/hooks/usePopulate.ts @@ -6,6 +6,8 @@ import { PopulationData, PopulationResponse } from '@/types/population' import { usePref } from '@/hooks/usePref' // 都道府県ごとの人口データを取得する関数 + +// TODO: 新規取得 map のところが処理重複してそう 毎回全データ取ってきてそう const fetchPopulationData = async (pref: { prefCode: number; prefName: string }[]) => { const promiseFunc = pref.map(async (item) => { // https://opendata.resas-portal.go.jp/docs/api/v1/population/composition/perYear.html diff --git a/src/hooks/usePref.ts b/src/hooks/usePref.ts index fc0487b..44519d7 100644 --- a/src/hooks/usePref.ts +++ b/src/hooks/usePref.ts @@ -47,5 +47,7 @@ export const usePref = () => { }) // 都道府県データ と その更新関数 を返す + + // TODO: Result だけでいけそうかも? return { pref, setPref } }