Skip to content

Commit e39defd

Browse files
committed
possibility of adding your axios instance to Service
1 parent f2c64d9 commit e39defd

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

dist/netlicensing-client.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/netlicensing-client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/netlicensing-client.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/netlicensing-client.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/services/Service.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,17 @@ import Constants from '../Constants';
99
import NlicError from '../errors/NlicError';
1010

1111
let httpXHR = {};
12+
let axiosInstance = axios;
1213

1314
export default class Service {
15+
static getAxiosInstance() {
16+
return axiosInstance;
17+
}
18+
19+
static setAxiosInstance(instanse) {
20+
axiosInstance = instanse;
21+
}
22+
1423
static getLastHttpRequestInfo() {
1524
return httpXHR;
1625
}
@@ -204,7 +213,7 @@ export default class Service {
204213
throw new Error('Unknown security mode');
205214
}
206215

207-
return axios(request)
216+
return Service.getAxiosInstance()(request)
208217
.then((response) => {
209218
httpXHR = response;
210219
return response;

0 commit comments

Comments
 (0)