AsyncState

Primitive #24

🔍 Problem it solves

Components that fetch data or upload files need to handle loading, success, and error states. Manually managing booleans and error messages leads to inconsistent UI behavior.

✅ Solution

The AsyncManager class manages a state machine: 'idle' | 'loading' | 'success' | 'error'. Provides wrap(promise), setLoading(), setSuccess(data), setError(error), and subscriptions.

🧩 Used by components

FileUpload, DataTable, UserProfile, CommentList, ProductGrid

🎮 Interactive demo