Petits fix sur le cache des requêtes Http
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
HttpEvent,
|
||||
HttpRequest,
|
||||
HttpResponse,
|
||||
HttpInterceptor,
|
||||
HttpHandler
|
||||
} from "@angular/common/http";
|
||||
} from '@angular/common/http';
|
||||
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import { startWith, tap } from "rxjs/operators";
|
||||
import "rxjs/add/observable/of";
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { startWith, tap } from 'rxjs/operators';
|
||||
import 'rxjs/add/observable/of';
|
||||
|
||||
import { RequestCache } from "./request-cache.service";
|
||||
import { RequestCache } from './request-cache.service';
|
||||
|
||||
@Injectable()
|
||||
export class CachingInterceptor implements HttpInterceptor {
|
||||
constructor(private cache: RequestCache) {}
|
||||
constructor(private cache: RequestCache) { }
|
||||
|
||||
intercept(req: HttpRequest<any>, next: HttpHandler) {
|
||||
const cachedResponse = this.cache.get(req);
|
||||
|
||||
Reference in New Issue
Block a user