Skip to content

export-mike/f-intercept

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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')
  })

About

a thin wrapper around the fetch api to provide you with a subscribe function to intercept 401 status responses, uses @export-mike/efetch for caching etags

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published