p3x-angular-http-cache-interceptor
Version:
🔥 Cache every request in Angular, not only the GET, but all methods of this interceptor, and allows you to interact with the interceptor via specific headers and modify the request, and these specific headers will be not included in the final request
16 lines (15 loc) • 837 B
TypeScript
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
import { Observable } from 'rxjs';
import { HttpCacheConfig } from "./http-cache-config";
import * as i0 from "@angular/core";
export declare class HttpCacheInterceptorInterceptor implements HttpInterceptor {
private cachedData;
httpCacheConfig: HttpCacheConfig;
getCache(key: string): any;
setCache(key: string, value: any): void;
constructor(httpCacheConfigToken: HttpCacheConfig);
httpToKey(httpRequest: HttpRequest<any>): string;
intercept(httpRequest: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
static ɵfac: i0.ɵɵFactoryDeclaration<HttpCacheInterceptorInterceptor, [{ optional: true; }]>;
static ɵprov: i0.ɵɵInjectableDeclaration<HttpCacheInterceptorInterceptor>;
}