Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor : service api.ts #480

Conversation

cmlim0070
Copy link
Collaborator

๐Ÿš€์š”์•ฝ

๐Ÿ“ธ์‚ฌ์ง„ (๊ตฌํ˜„ ์บก์ฒ˜)

๐Ÿ“์ž‘์—… ๋‚ด์šฉ

  • ์š”์ฒญ ๋Œ€๊ธฐ ๋ฐฐ์—ด ์‚ฝ์ž…์‹œ ๋ˆ„๋ฝ๋œ reject ์ธ์ž ์ถ”๊ฐ€
  • ๊ธฐ์กด ๋ชจ๋“  ์—๋Ÿฌ๊ฐ€ ๋„คํŠธ์›Œํฌ ์—๋Ÿฌ๋กœ ๋„˜์–ด์˜ค๋Š” ์‚ฌํ•ญ ๊ฐœ์„ 
  • ๋Œ€๊ธฐ ๋ฐฐ์—ด ์ฒ˜๋ฆฌ ๋กœ์ง ๋ณ€๊ฒฝ
// ๊ธฐ์กด
let refreshSubscribers: ((token: string) => void)[] = [];
refreshSubscribers.forEach((callback) => callback(newAccessToken));

// ๋ณ€๊ฒฝ
interface QueueItem {
    resolve: (token: string) => void;
    reject: (error: QueueError) => void;
}
const processQueue = (error: QueueError | null, token: string | null): void => {
    requestQueue.forEach((promise: QueueItem) => {
        if (error) {
            promise.reject(error);
        } else if (token) {
            promise.resolve(token);
        }
    });
    requestQueue = [];
};

๐Ÿ”๋ฐฑ์—”๋“œ ์ „๋‹ฌ ์‚ฌํ•ญ

๐ŸŽธ๊ธฐํƒ€ (์—ฐ๊ด€ ์ด์Šˆ)

๊ธฐ์กด ๋ธŒ๋žœ์น˜์— ๋ฌธ์ œ๊ฐ€ ์žˆ์–ด ์ด์ „ PR์€ close ํ•˜๊ณ  ์ƒˆ๋กœ ์—ด์—ˆ์Šต๋‹ˆ๋‹ค!

ํ…Œ์ŠคํŠธ ํ•„์š” ์‚ฌํ•ญ

  • ํ† ํฐ ๋งŒ๋ฃŒ ์‹œ ๊ฐฑ์‹  ๋™์ž‘ ํ™•์ธ
  • ์—ฌ๋Ÿฌ ์š”์ฒญ์ด ๋™์‹œ์— 401 ์—๋Ÿฌ๋ฅผ ๋ฐ›์•˜์„ ๋•Œ ์ฒ˜๋ฆฌ
  • ๋‹ค์–‘ํ•œ ์—๋Ÿฌ ์ƒํ™ฉ์—์„œ์˜ ๋™์ž‘ ํ™•์ธ

์ถ”๊ฐ€ ๊ฐœ์„ ์ด ํ•„์š”ํ•œ ๋ถ€๋ถ„ ๐Ÿšจ

  • ํ˜„์žฌ ๋ชจ๋“  API ์š”์ฒญ์— ํ† ํฐ์ด ํฌํ•จ๋˜๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค

TODO (๋ณ„๋„ PR๋กœ ๋ถ„๋ฆฌํ•˜์—ฌ ์ฒ˜๋ฆฌํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค)

  • API ์ธ์Šคํ„ด์Šค๋ฅผ ์šฉ๋„๋ณ„๋กœ ๋ถ„๋ฆฌ ex) authApi: ์ธ์ฆ์ด ํ•„์š”ํ•œ ์š”์ฒญ / publicApi: ์ธ์ฆ์ด ํ•„์š”์—†๋Š” ์š”์ฒญ (๋กœ๊ทธ์ธ, ํšŒ์›๊ฐ€์ž… ๋“ฑ)

close #471

Copy link

โœ… Build ์„ฑ๊ณต!

Copy link

โšก๏ธ Lighthouse Report (Average of 5 runs)

Category Score
๐ŸŸ  Performance 77
๐ŸŸ  Accessibility 65
๐ŸŸข SEO 90
๐ŸŸข Best Practices 100

Core Web Vitals (Average)

Metric Value
๐Ÿ”ด First Contentful Paint 3.9 s
๐Ÿ”ด Largest Contentful Paint 4.1 s
๐ŸŸข Cumulative Layout Shift 0.0

@cmlim0070 cmlim0070 merged commit 025f5a1 into main Jan 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
โ™ป๏ธ refactor ๋ฆฌํŽ™ํ† ๋ง
Projects
None yet
1 participant