{"id":13847308,"url":"https://github.com/lennerd/react-pending-resource","last_synced_at":"2026-02-03T12:38:00.705Z","repository":{"id":57342374,"uuid":"322911337","full_name":"lennerd/react-pending-resource","owner":"lennerd","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-18T14:32:01.000Z","size":1351,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-07T06:45:22.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lennerd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-19T18:22:39.000Z","updated_at":"2021-09-02T18:32:44.000Z","dependencies_parsed_at":"2022-09-16T03:02:00.051Z","dependency_job_id":null,"html_url":"https://github.com/lennerd/react-pending-resource","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/lennerd/react-pending-resource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lennerd%2Freact-pending-resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lennerd%2Freact-pending-resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lennerd%2Freact-pending-resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lennerd%2Freact-pending-resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lennerd","download_url":"https://codeload.github.com/lennerd/react-pending-resource/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lennerd%2Freact-pending-resource/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264962222,"owners_count":23689765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T18:01:16.325Z","updated_at":"2026-02-03T12:38:00.649Z","avatar_url":"https://github.com/lennerd.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# React Pending Resource\n\n![CI Status](https://github.com/lennerd/react-pending-resource/workflows/CI/badge.svg)\n\nReact Pending Resource is a small library of hooks for handling promises (for example when fetching data asynchronously).\nThough feature complete it is still in beta and not fully battle tested yet.\nA dedicated page with more information, examples and documentation coming soon.\n\n## Why another async hook library for React?\n\n* Powerful caching by using serializable resource keys\n* Easy refetching of resources by using resource keys and more complex dependencies if needed\n* Easy preloading of resources for better performance\n* Built around stable Suspense features (without using experimental APIs)\n* Easy deferring of rendering suspense fallbacks like loading spinners\n\n*This library cannot be used in components rendered on the server, as React Suspense does not support server side rendering yet.*\n\n## Example\n\n```tsx\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { usePromise } from 'react-pending-resource';\n\nasync function fetchPost(id) {\n  // … fetch a post by id\n}\n\nfunction BlogPost({ id }) {\n  const post = usePromise(id, () =\u003e fetchPost(id));\n\n  return \u003cdiv\u003e{post.title}\u003c/div\u003e\n}\n\nfunction App() {\n  return (\n    \u003cReact.Suspense fallback=\"Loading …\"\u003e\n      \u003cBlogPost id={1} /\u003e\n    \u003c/React.Suspense\u003e\n  );\n}\n\nReactDOM.render(\u003cApp /\u003e, document.getElementById('root'));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flennerd%2Freact-pending-resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flennerd%2Freact-pending-resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flennerd%2Freact-pending-resource/lists"}