We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
影片中可以看出前端可能一次性打非常多個 api,這初步反映出兩種問題
影片中 un-focus -> focus 就會去打 api 的效果應該是 TanStank Query 的預設行為
Stale queries are refetched automatically in the background when: The window is refocused
Stale queries are refetched automatically in the background when:
因應 #6 我們若只希望只打一次 api,後面要才對 TanStack Query 設定做調整
我們在聊這個議題的時候,有順便聊到 Chrome DevTools Network 的常用功能 #11,其中我們也有觀察到 https://pokeapi.co/api/v2 的 api 有使用 Http cache 來減輕 server 負擔。這時的 request 其實沒有真的跑出網路,而只是列在上面表示你的網頁有這個 request,且瀏覽器從硬碟直接取回 cached response
The text was updated successfully, but these errors were encountered:
所以才有必要分別打出20支API的需求,原本有考慮使用graphQL代替,但是提供的資源找不到能夠兜的資料,所以才這樣做。 Refocus的問題,確實不需要再此情況下再次取回資料,所以可以透過設定取消此預設值
我的理解是,前端不直接與後端溝通,而是透過一個中間人向後端取資料,實作上的優缺點差別可能要實際應用才比較了解
Sorry, something went wrong.
No branches or pull requests
影片中可以看出前端可能一次性打非常多個 api,這初步反映出兩種問題
bandicam.2024-02-22.16-33-42-344.mp4
任務
By the way
影片中 un-focus -> focus 就會去打 api 的效果應該是 TanStank Query 的預設行為
因應 #6 我們若只希望只打一次 api,後面要才對 TanStack Query 設定做調整
我們在聊這個議題的時候,有順便聊到 Chrome DevTools Network 的常用功能 #11,其中我們也有觀察到 https://pokeapi.co/api/v2 的 api 有使用 Http cache 來減輕 server 負擔。這時的 request 其實沒有真的跑出網路,而只是列在上面表示你的網頁有這個 request,且瀏覽器從硬碟直接取回 cached response
The text was updated successfully, but these errors were encountered: