A tiny version of fetch for the browser (not a pollyfill)
npm install chad-fetch
import fetch from 'chad-fetch'
// fetch.get(url, queryParams?) returns T
fetch
.get<T>('https://rickandmortyapi.com/api/character', { page: 1 })
.then(res => console.log(res))
// fetch.post(url, data) returns T | only uploads objects
fetch
.post<T>('https://jsonplaceholder.typicode.com/posts', {
title: 'foo',
body: 'bar',
userId: 1,
})
.then(res => console.log(res))