depromeet / ahmatda-web

์•„๋งž๋‹ค :white_check_mark: ์ด์   ๊นŒ๋จน์ง€ ๋ง๊ณ  ์ฑ™๊ธฐ์ž
https://github.com/depromeet/ahmatda-web#download
7 stars 0 forks source link

LoadingHandler #140

Closed hyesungoh closed 1 year ago

hyesungoh commented 1 year ago

๐Ÿค” ํ•ด๊ฒฐํ•˜๋ ค๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฌด์—‡์ธ๊ฐ€์š”?

๐ŸŽ‰ ์–ด๋–ป๊ฒŒ ํ•ด๊ฒฐํ–ˆ๋‚˜์š”?

์‚ฌ์šฉ ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™์•„์š”

 const {data, isLoading} = useQuery();

 return (
  <LoadingHandler isLoading={isLoading} fallback={<SomeSpinner />}>
    {data}
  </LoadingHandler>
 )

๋‹ค๋ฅธ ์šฐ์•„ํ•œ ๋ฐฉ๋ฒ• ๊ณต์œ ํ•ด์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค !!

๐Ÿ“š Attachment (Option)

cloudflare-pages[bot] commented 1 year ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 58f17ab
Status: โœ…  Deploy successful!
Preview URL: https://936c907d.12-team3-web.pages.dev
Branch Preview URL: https://issue-133.12-team3-web.pages.dev

View logs

github-actions[bot] commented 1 year ago

Bundle Sizes

Compared against 340ea7171a07a281032be401e5dc6c08de51a4b0

Route: No significant changes found

Dynamic import: No significant changes found

codecov-commenter commented 1 year ago

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:

Coverage data is based on head (58f17ab) compared to base (340ea71). Patch has no changes to coverable lines.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #140 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 21 21 Lines 191 191 Branches 37 37 ========================================= Hits 191 191 ``` Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=depromeet). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=depromeet)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

hyesungoh commented 1 year ago

์•„์ง ์ƒ์ƒ์ฝ”๋”ฉ์ด๊ธดํ•œ๋ฐ axios intercepter๋ฅผ ์ด์šฉํ•ด์„œ ๋กœ๋”ฉ ์‹ฌ๋Š”๊ฑด...๊ทธ๋Ÿผ ๋ชจ๋“  axios ์š”์ฒญ์— ๋กœ๋”ฉ ๋ณด์—ฌ์ค„์ˆ˜ ์žˆ์ง€์•Š์„๊นŒ ์ƒ๊ฐํ•˜๋Š”๋ฐ ์‹ค์ œ ๊ฐœ๋ฐœํ•˜๋ฉด ์–ด๋–ค ์ด์Šˆ๋ž‘ ๋ฌธ์ œ์ ์ด ์žˆ์„์ง€ ๋ชฐ๋ผ์„œ ์ผ๋‹จ ๋„์ ์—ฌ๋งŒ ๋ด…๋‹ˆ๋‹ค.

์˜คํ˜ธ ์ƒ์ƒ์ฝ”๋”ฉ์ฒœ์žฌ ๐Ÿ‘ react-query๋ฅผ ์•ˆ์“ด๋‹ค๋ฉด ๊ทธ๋ ‡๊ฒŒ๋„ ํ•  ์ˆ˜ ์žˆ๊ฒ ๋„ค์š” ! ๐Ÿ‘ ๐Ÿ‘

๊ทผ๋ฐ ๋ฆฌ์•กํŠธ ์ฟผ๋ฆฌ์—์„œ isLoading์„ ์ œ๊ณตํ•ด์ค˜์„œ ๊ดœ์ฐฎ์„๋“ฏ !! https://tanstack.com/query/v4/docs/adapters/react-query