FetchResult
katanakit-js / FetchResult
Type Alias: FetchResult<T>
Section titled “Type Alias: FetchResult<T>”type FetchResult<T> = | { data: T; error: null; ok: true; status: number; url: string; } | { data: null; error: ApiError; ok: false; status: number; url: string; };Defined in: types/core/http.ts:67
Safe result, discriminated union (Astro Actions style) without throwing.
The ok flag narrows the union between the success and error branches.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T |
unknown |