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

Puppeteer로 성능 측정 스크립트 작성, 중복입장 개발환경에서 가능하도록 수정 #2

Merged
merged 8 commits into from
Jan 24, 2025
Prev Previous commit
Next Next commit
refactor: 💡 키워드와 관련된 매직 넘버 상수화 및 파일 분리
23YUJIN committed Jan 17, 2025
commit 1b5fded4f4ed2a9a38fe7b54a1127a75554e4bb9
2 changes: 2 additions & 0 deletions frontend/src/constants/keywords.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const MAX_KEYWORDS_NUM = 50;
export const KEYWORDS_PROCESS_INTERVAL = 300;
3 changes: 2 additions & 1 deletion frontend/src/pages/room/KeywordsView.tsx
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import { useSocketStore } from '@/stores';
import { useKeywordsStore } from '@/stores/keywords';
import { keywordStyleMap, scaleIn, Variables } from '@/styles';
import { Group, Keyword, KeywordInfo, KeywordsCoordinates, PrefixSum } from '@/types';
import { KEYWORDS_PROCESS_INTERVAL } from '@/constants/keywords';

interface KeywordsViewProps {
questionId: number;
@@ -66,7 +67,7 @@ const KeywordsView = memo(({ questionId, selectedKeywords, updateSelectedKeyword
updateTimeout = setTimeout(() => {
processQueue();
updateTimeout = undefined;
}, 1500);
}, KEYWORDS_PROCESS_INTERVAL);
}
});
}
3 changes: 1 addition & 2 deletions frontend/src/stores/keywords.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { create } from 'zustand';

import { Keyword, KeywordInfo, Keywords, PrefixSumMap, CommonResult } from '@/types';

const MAX_KEYWORDS_NUM = 30;
import { MAX_KEYWORDS_NUM } from '@/constants/keywords';

interface KeywordsStore {
keywords: Keywords;