A React hook for asynchronous state.

Charles Stover
Nov 2 · 4 min read

Modern day user interfaces are expected to handle asynchronous state changes. Whether it is server communication, offloaded computations, or permission-based browser APIs, developers need to convey to their customers what is happening, has happened, is going to happen, and what went wrong.

A common pattern arises in React applications, where — in addition to the asynchronous functionality — the component’s local state must update for each step in the state machine: uninitiated, pending, fulfilled, and rejected.

Keep the story going. Sign up for an extra free read.

You've completed your member preview for this month, but when you sign up for a free Medium account, you get one more story.
Already have an account? Sign in

Charles Stover

Written by

Senior Full Stack JavaScript Developer / charlesstover.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade