-
Notifications
You must be signed in to change notification settings - Fork 2
[Init]: Tanstack Query 기본 세팅 #18
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
adbfe43
init: Tanstack Query 기본 세팅
shinjigu 9acd6b7
refactor: queryClient 설정 별도 파일로 분리
shinjigu 9d5c807
chore: 불필요한 .gitkeep 파일 삭제
shinjigu d1af47b
Merge branch 'develop' into init/#16/tanstackQuery
jisooooooooooo 6262a4e
Merge branch 'develop' into init/#16/tanstackQuery
shinjigu 6032c97
fix: React Query 의존성 패키지 추가
shinjigu eadd9d3
fix: ESLint 자동 포맷팅 적용
shinjigu 4636dd6
Merge remote-tracking branch 'origin/develop' into init/#16/tanstackQ…
shinjigu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { QueryClient } from '@tanstack/react-query'; | ||
|
|
||
| export const queryClient = new QueryClient({ | ||
| defaultOptions: { | ||
| queries: { | ||
| staleTime: 1000 * 60 * 1, | ||
| refetchOnWindowFocus: false, | ||
| refetchOnMount: true, | ||
| refetchOnReconnect: false, | ||
| retry: 2, | ||
| }, | ||
| mutations: { | ||
| retry: 1, | ||
| }, | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,19 @@ | ||
| import { StrictMode } from 'react'; | ||
| import { createRoot } from 'react-dom/client'; | ||
|
|
||
| import App from './App.tsx'; | ||
|
Check warning on line 4 in src/main.tsx
|
||
|
|
||
| import './style/global.css.ts'; | ||
| import { QueryClientProvider } from '@tanstack/react-query'; | ||
| import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; | ||
|
|
||
| import { queryClient } from './common/util/queryClient.ts'; | ||
|
|
||
| createRoot(document.getElementById('root')!).render( | ||
| <StrictMode> | ||
| <App /> | ||
| <QueryClientProvider client={queryClient}> | ||
| <App /> | ||
| {import.meta.env.DEV && <ReactQueryDevtools initialIsOpen={false} />} | ||
| </QueryClientProvider> | ||
| </StrictMode>, | ||
| ); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p3)
queryClient부분 별도 파일로 분리해도 좋아 보이네욤There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jisooooooooooo 그러면 queryClient 설정을
src/common/util/queryClient.ts로 분리하겠습니다 ! queryClient는 특정 도메인에 속하지 않고 전역적으로 사용되는 설정이므로 common 영역에 배치하고, 외부 라이브러리를 사용한 설정이지만 컴포넌트가 아닌 유틸리티 성격이므로 util 폴더에 위치시켰습니당