The type of the data expected in a successful response.
import { fetchT, type FetchResult } from '@happy-ts/fetch-t';
// FetchResult is a Promise that resolves to Result<T, Error>
const result: FetchResult<string> = fetchT('https://api.example.com', {
responseType: 'text',
});
const res = await result;
res
.inspect((text) => console.log('Success:', text))
.inspectErr((err) => console.error('Error:', err));
Represents the result of a fetch operation as an async Result type.
This is an alias for
AsyncIOResult<T>from thehappy-rustylibrary, providing Rust-like error handling without throwing exceptions.