From 3e2d961a2eeb970e2a711e596cf5af4736785721 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 23 Dec 2021 20:11:18 +0200 Subject: [PATCH] fixed error, not using createAxiosRetry() when not using register/registerAsync() --- lib/http.module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/http.module.ts b/lib/http.module.ts index 065d4b7..7827b19 100644 --- a/lib/http.module.ts +++ b/lib/http.module.ts @@ -14,7 +14,7 @@ import { } from './interfaces'; import axiosRetry from 'axios-retry'; -const createAxiosRetry = (config: HttpModuleOptions) => { +const createAxiosRetry = (config?: HttpModuleOptions) => { const axiosInstance = Axios.create(config); axiosRetry(axiosInstance, config); return axiosInstance; @@ -25,7 +25,7 @@ const createAxiosRetry = (config: HttpModuleOptions) => { HttpService, { provide: AXIOS_INSTANCE_TOKEN, - useValue: Axios, + useValue: createAxiosRetry(), }, ], exports: [HttpService],