Skip to content

Commit aba9db6

Browse files
committed
style: 오고 있는 편지 함수 선언을 화살표 함수로 변환
1 parent ae5d936 commit aba9db6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/stores/incomingLettersStore.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ interface IncomingLettersStore {
1717
fetchIncomingLetters: () => void;
1818
}
1919

20-
function formatTime(time: number): string {
21-
return time < 10 ? `0${time}` : `${time}`;
22-
}
20+
const formatTime = (time: number): string => (time < 10 ? `0${time}` : `${time}`);
2321

24-
function calculatingRemainingTime(deliveryCompletedAt: string): string {
22+
const calculatingRemainingTime = (deliveryCompletedAt: string): string => {
2523
const completedAt = new Date(deliveryCompletedAt).getTime();
2624
const now = new Date().getTime();
2725
const diff = completedAt - now;
@@ -33,7 +31,7 @@ function calculatingRemainingTime(deliveryCompletedAt: string): string {
3331
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
3432

3533
return `${formatTime(hours)}:${formatTime(minutes)}:${formatTime(seconds)}`;
36-
}
34+
};
3735

3836
export const useIncomingLettersStore = create<IncomingLettersStore>((set) => ({
3937
data: [],

0 commit comments

Comments
 (0)