Petits fix sur le cache des requêtes Http

This commit is contained in:
Sébastien André
2019-11-20 10:46:43 +01:00
parent 53ff769188
commit 3a66d5e6ac
2 changed files with 29 additions and 19 deletions

View File

@@ -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);