@osaas/fetch
v0.4.2
Published
> TODO: description
Readme
@osaas/fetch
Fetch with typing and common error handling
Usage
import { createFetch } from '@osaas/fetch';
type Payload = {
data: string;
};
try {
const body = await createFetch<Payload>('https://mock.com/test');
console.log(body.data);
} catch (error) {
console.error(`${error.httpCode}: ${error.message}`);
}