@aesop-fables/containr-axios
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

@aesop-fables/containr-axios

Provides a common bootstrapping configuration for using Axios in your Typescript applications (i.e., scrinium apps).

Sample Usage

// Example setup
const container = createContainer([
  useAxios({
    // optionally pass in anything you would to axios.create
    baseURL: 'http://localhost:8080',
  })
  myCustomModule,
]);

// Example usage
class MyApi {
  constructor(@inject(AxiosServices.AxiosInstance) private reaodnly axios: AxiosInstance) {}

  listItems(): AxiosResponse<MyModel[]> {
    return this.axios.get('/list');
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @aesop-fables/containr-axios

Weekly Downloads

3

Version

0.3.1

License

none

Unpacked Size

9.62 kB

Total Files

11

Last publish

Collaborators

  • barretts
  • jmarnoldsan