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:
commit
a349894f12
1 changed files with 2 additions and 2 deletions
|
@ -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],
|
||||||
|
|
Loading…
Reference in a new issue