المشاريع
عرض على GitHub
bvaughn/suspense
حول
Utilities for working with React Suspense
تطوير الويب والتطبيقاتالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- ٠
- خلال شهر
- التحديث متأخر
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلsuspense
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.
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…