1.0.6 • Published 2 years ago

chad-fetch v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Chad Fetch MIT License Code Coverage

A tiny version of fetch for the browser (not a pollyfill)

Logo

Installation

  npm install chad-fetch

Usage

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))
1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago