A fetch wrapper with typesafe and easy to use.
npm install fecho
yarn add fecho
pnpm add fechoimport { fecho } from 'fecho';
type User = {
id: number;
name: string;
};
const response = await fecho<User>(
'https://jsonplaceholder.typicode.com/users/1',
);
console.log(response.data); // { id: 1, name: 'Leanne Graham' }