Skip to content

Commit 7ccadae

Browse files
committed
feat: fetch other subway line infos when idle (#develop)
1 parent 4a6cabf commit 7ccadae

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

services/ahhachul.com/src/components/domain/home/stations/Stations.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const Stations = () => {
2929
const stationId = stations[0].stationId;
3030
const subwayLineInfoList = stations[0].subwayLineInfoList;
3131

32-
const prefetchOtherLines = async () => {
32+
const prefetchOtherLines = () => {
3333
const copy = [...subwayLineInfoList];
3434
copy.unshift();
3535
copy.forEach(async ({ subwayLineId }) => {

services/ahhachul.com/src/components/domain/home/stations/trainRealTimes/TrainRealTimes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const RefreshButton = ({ onRefresh }: RefreshButtonProps) => {
123123
interface TrainRealTimesProps extends WithSubwayStationId {
124124
stationName: string;
125125
subwayLineId: number;
126-
prefetchOtherLines: () => Promise<void>;
126+
prefetchOtherLines: () => void;
127127
}
128128

129129
const TrainRealTimes = ({

services/ahhachul.com/src/services/subway.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ export const useFetchSubwayLines = () =>
2828
},
2929
});
3030

31-
export const useFetchTrainInfo = (
32-
params: APITrainInfoParams,
33-
prefetchOtherLines: () => Promise<void>,
34-
) => {
31+
export const useFetchTrainInfo = (params: APITrainInfoParams, prefetchOtherLines: () => void) => {
3532
const res = useQuery({
3633
staleTime: 0,
3734
refetchInterval: 30 * TIMESTAMP.SECOND,

0 commit comments

Comments
 (0)