Skip to content

Commit

Permalink
fix($interceptor): Converted function to arrow function so that this …
Browse files Browse the repository at this point in the history
…can be interpreted correctly
  • Loading branch information
thekalinga committed May 23, 2017
1 parent 881506d commit 4005451
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/interceptor-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ export class InterceptorService extends Http {
.options(interceptorOptions)
.sharedData(interceptorOptions.sharedData || {})
.build();
return Observable.create(function (observer: Subscriber<Response>) {

return Observable.create((observer: Subscriber<Response>) => {
const subscription = this.httpRequest(request).subscribe(
(response: Response) => observer.next(response),
(e: Error) => observer.error(e),
() => observer.complete()
);
observer.add(() => {
this.interceptors.reverse().forEach((interceptor: Interceptor, index: number) => {
this.interceptors.reverse().forEach((interceptor, index) => {
interceptor.onUnsubscribe(index, url, options);
});
});
Expand Down

0 comments on commit 4005451

Please sign in to comment.