-
Trend
- Information (old days)
- render content at server
- Single page application
- Heaviy data interaction at the frontend side
- Render content at the frontend side
- Information (old days)
-
Problem
- state management
- solutions
- props drilling -> redux/context or similar libraries
- problems of redux
- with application growth, the global state could be gigantic
- problems of redux
- props drilling -> redux/context or similar libraries
- solutions
- Asynchronous interaction with the server
- Old solutions
- redux-thunk
- rematch
- problems
- Duplication request
- Using hooks, redundant code
- Retry failed request
- Fetch data conditionally
- How to cache data at the frontend side
- Old solutions
- Separate application into two parts
- Application state(synchronous, disappear after clearing)
- local state
- global state
- server caching state
- Application state(synchronous, disappear after clearing)
- state management
-
React-Query
- downloads
- file size
- users
- activities
-
Features
- hooks based
- configurable
- remove duplicated request && caching ===> solve the problem of having a gigantic application state using redux/mobx/context
- stale
- cache time
- conditional data fetching, prefetching
- access data stored globally
- query client
- focus prefetching
- retries