@stone-ton/axios-wrapper
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

axios-wrapper

Lib para fazer wrapper do axios

Usage

import { AxiosRequestConfig } from 'axios'
import {
  axiosRequest
} from '@stone-ton/axios-wrapper'

interface FooInput {
  bar: string
}

interface Foo {
  id: string
  bar: string
}

const result = await axiosRequest<Foo, FooInput>({
  url: 'http://localhost:3000',
  method: 'POST',
  timeout: 3000,
  data: {
    bar: '🍌'
  }
})

// result = {
//   data: { id: '12':  bar: '🍌' }
// }

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i @stone-ton/axios-wrapper

    Weekly Downloads

    56

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    28.2 kB

    Total Files

    30

    Last publish

    Collaborators

    • stonemaistech