Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

f-intercept

1.2.0 • Public • Published

f-intercept

a thin wrapper around fetch api we use the eFetch library to handle basic e-tag caching in memory.

Usage:

  import f, {onUnauth} from 'f-intercept'
  
  const apiFetch = f(BASE_API)
  
  apiFetch('path/to/resource', fetchOptions)
  
  onUnauth(BASE_API, () => {
    console.log('intercepted 401 unauthorized response')
  })

install

npm i f-intercept

Downloadsweekly downloads

16

version

1.2.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar