React, Concurrent mode with Recoil
Inspiration
We considered whether Recoil's data fetch implementation could be combined with React's concurrent mode (Render-as-You-Fetch).
Data fetch and Rendering timing flow
- External Api: Get external api
- Adapter: Make the return value of the external API consistent with the value you want to use in the application (use Recoil's selector)
- Fetcher: Combine adapters as one resource (as Redux's combineReducer method)
- Initialize Fetcher: Start getting resources before rendering
<Component />
under<Suspense />
read resources: Read the acquired resource