Skip to content

Instantly share code, notes, and snippets.

@oleh-zaporozhets
Created October 23, 2021 18:50
Show Gist options
  • Select an option

  • Save oleh-zaporozhets/ea5a8a0f7b1b4346c6492d827e1e3024 to your computer and use it in GitHub Desktop.

Select an option

Save oleh-zaporozhets/ea5a8a0f7b1b4346c6492d827e1e3024 to your computer and use it in GitHub Desktop.
...
constructor(http: IHttp, options: ICircuitBreakerOptions) {
this.http = http;
this.timeout = options.timeout;
this.errorHandler = options.errorHandler;
this.http.instance.interceptors.request.use(this.interceptRequest.bind(this));
this.http.instance.interceptors.response.use(
(response: AxiosResponse) => response,
this.interceptErrorResponse.bind(this),
);
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment