Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/graphql / src / bootstrapper / api / axios.ts
Size: Mime:
import { defineFinal } from 'chain-able-boost'
import { asyncWrap } from 'chain-able-lego/dist/wrap/asyncWrap'
import { axiosInstance } from './ENV'

// wrapper around axios for handling errors in a sane way
// without rejected promises that are hard to track
const GET = asyncWrap(axiosInstance.get)
const POST = asyncWrap(axiosInstance.post)
const AXIOSER = asyncWrap(axiosInstance)
const FETCHREQUEST = asyncWrap(axiosInstance.request)
defineFinal(GET, 'methodName', 'GET')
defineFinal(POST, 'methodName', 'POST')
defineFinal(AXIOSER, 'methodName', 'AXIOSER')
defineFinal(FETCHREQUEST, 'methodName', 'REQUEST')

export { GET, POST, AXIOSER, FETCHREQUEST, API_LAYER_IMPORT }
export { asyncWrap }
export { axiosInstance as axios }

// fetch specific settings - unused currently because we are using axios
// these will be used for when we use webworkers
//
// getInit = {
//   method: 'GET',
//   mode: 'no-cors',
// }