Merge pull request #6 from benhason1/hotfix--use-create-axios-instance-without-register

fixed error, not using createAxiosRetry() when not using register/reg…
This commit is contained in:
benhason1 2021-12-23 20:13:05 +02:00 committed by GitHub
commit a349894f12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ import {
} from './interfaces'; } from './interfaces';
import axiosRetry from 'axios-retry'; import axiosRetry from 'axios-retry';
const createAxiosRetry = (config: HttpModuleOptions) => { const createAxiosRetry = (config?: HttpModuleOptions) => {
const axiosInstance = Axios.create(config); const axiosInstance = Axios.create(config);
axiosRetry(axiosInstance, config); axiosRetry(axiosInstance, config);
return axiosInstance; return axiosInstance;
@ -25,7 +25,7 @@ const createAxiosRetry = (config: HttpModuleOptions) => {
HttpService, HttpService,
{ {
provide: AXIOS_INSTANCE_TOKEN, provide: AXIOS_INSTANCE_TOKEN,
useValue: Axios, useValue: createAxiosRetry(),
}, },
], ],
exports: [HttpService], exports: [HttpService],