slorber/react-async-hook
React hook to handle any async operation in React components, and prevent race conditions observed · 2026-08-28
Health v2 · maintenance only
23/100
- Activity 0
- Release rhythm 8
- Longevity 100
Flags: no_license
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 2867
- days_rel: n/a
- days_push: 1152
- n_releases_24m: 0
Adoption not part of the score
1189 stars · 47 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A tiny, feature-complete React hook library for handling async operations in components. It provides useAsync, useAsyncCallback, and useAsyncAbortable hooks that manage loading state, cancellation, and race condition prevention.
Use cases
- fetch data in react components without race conditions
- handle async mutations with loading state in react
- cancel stale api requests when params change in react
- refetch data when dependencies change with a react hook
- manage promise state in react native apps
- prevent outdated search results from overwriting newer ones in react
When to choose
- you want a tiny, zero-dependency alternative to react-query or swr for simple async needs
- you need fine-grained control over async state and race condition handling
- you work with react or react-native and want stable callbacks and abortable fetches
- you want a feature-complete library that will not grow in size
When to avoid
- you need caching, retries, or a full data-fetching framework like react-query or swr
- you rely on react server components or suspense-first data fetching
- you need a library with active development and recent releases
- you want built-in devtools or cache invalidation features
Facets
library · maturity maintenance
state-management http-client middleware web-development frontend developer-tools cross-platform react react-hooks async race-conditions fetch typescript useasync abortion-controller cancellation nodejs web-server
3 sources
- readme: https://github.com/slorber/react-async-hook · fetched 2026-08-28 · 360ab4ab952c
- homepage: https://sebastienlorber.com/handling-api-request-race-conditions-in-react · fetched 2026-08-29 · a248bef87b1c
- registry_npm: https://registry.npmjs.org/react-async-hook · fetched 2026-08-29 · 095e9097ee9d
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| slorber/react-async-hook | main | 23 |
For agents
markdown · JSON · MCP: product_card(name="slorber/react-async-hook")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem