Proyek
Lihat di GitHub
bvaughn/suspense
Tentang
Utilities for working with React Suspense
Pengembangan web dan aplikasiPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- 0
- dalam 1 bulan
- Pembaruan tertunda
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
Aslisuspense
APIs to simplify data loading and caching. Primarily intended for use with React Suspense.
⚠️ Considerations
- Suspense is an experimental, pre-release feature; these APIs will change along with React.
- This package depends on
react@experimentalandreact-dom@experimentalversions.
Example
import { createCache } from "suspense";
const userProfileCache = createCache({
load: async ([userId]) => {
const response = await fetch(`/api/user?id=${userId}`);
return await response.json();
},
});
function UserProfile({ userId }) {
const userProfile = userProfileCache.read(userId);
// ...
}
More examples at suspense.vercel.app.
If you like this project, buy me a coffee.
Jelajahi proyek terkait
Memuat…