{"library":"suspend-react","type":"library","category":null,"description":"suspend-react is a utility library for integrating asynchronous operations seamlessly with React Suspense. It allows developers to define functions that return promises, which then 'suspend' rendering until the promise resolves, effectively bringing an `async/await` like paradigm to React components. The library manages pending and error states at a higher level via React's `<Suspense>` and Error Boundaries, reducing boilerplate in individual components. It features a global, key-based caching mechanism, similar to `useMemo` but with application-wide scope, supporting configurable cache invalidation via `lifespan` and custom equality functions. Additionally, it offers preloading, cache busting, and direct cache peeking utilities. The current stable version is 0.1.3, with recent patch releases in June 2023, indicating a stable yet actively maintained project under the pmndrs umbrella. It simplifies data fetching and resource loading within Suspense-enabled React applications.","language":"javascript","status":"active","version":"0.1.3","tags":["javascript","react","suspense","resource","asset","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install suspend-react","imports":["import { suspend } from 'suspend-react'","import { preload } from 'suspend-react'","import { clear } from 'suspend-react'","import { peek } from 'suspend-react'"]},{"cmd":"yarn add suspend-react","imports":[]},{"cmd":"pnpm add suspend-react","imports":[]}],"homepage":null,"github":"https://github.com/pmndrs/suspend-react","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/suspend-react","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/suspend-react/compatibility"}}