Generic async hook — wraps any async function with loading/failure/data
state. Auto-executes on mount and when deps change.
If the function returns a FetchResponse (from FetchEngine methods), the
.data property is automatically unwrapped, and an ok: false response
sets failure: { kind: 'http', response } instead of being treated as
success. useAsync wraps an arbitrary function, so it can't promise a
FetchError the way useQuery does — a rejection sets
failure: { kind: 'rejected', error } with the thrown value as-is.
Generic async hook — wraps any async function with loading/failure/data state. Auto-executes on mount and when deps change.
If the function returns a FetchResponse (from FetchEngine methods), the
.dataproperty is automatically unwrapped, and anok: falseresponse setsfailure: { kind: 'http', response }instead of being treated as success.useAsyncwraps an arbitrary function, so it can't promise aFetchErrorthe wayuseQuerydoes — a rejection setsfailure: { kind: 'rejected', error }with the thrown value as-is.