Pattern: Data Fetching & Async Flows

Model async data fetching, retry, cancellation, and cache states.

Overview

Data fetching is a perfect fit for state machines: idle → loading → success / error, with retry, refresh, and cancellation as transitions.

Key Concepts


    States: idle → loading → success / error / empty

    Guard: canRefresh, canRetry

    Context for response data and error info

    Cancellation via abort signal

Related Pages


TODO


    Add retry with exponential backoff machine

    Add caching machine

    Add polling machine

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Connections0

Connections show where other documents or comments link to this document.

Related documents

Loading connections…