ngx-crud
Version:
CRUD services in Angular with effortless aborting, caching and observing
27 lines (26 loc) • 1.39 kB
TypeScript
import { HttpContextToken, HttpErrorResponse, HttpRequest, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { ReactiveMap } from 'rxjs-collection';
import { ObserveAfterEffect, ObserveBeforeEffect, Context, Store } from './observe.interface';
import * as i0 from "@angular/core";
export declare class ObserveService {
protected observeEffect: ObserveBeforeEffect | ObserveAfterEffect;
protected defaultContext: Context;
protected token: HttpContextToken<Context>;
protected store: ReactiveMap<string, Store>;
constructor(observeEffect: ObserveBeforeEffect | ObserveAfterEffect);
getToken(): HttpContextToken<Context>;
start<T>(request: HttpRequest<T>): this;
before<T>(request: HttpRequest<T>): HttpRequest<T>;
after<T>(request: HttpRequest<T>, response: HttpResponse<T> | HttpErrorResponse): this;
has<T>(request: HttpRequest<T>): boolean;
error(urlWithParams: string): this;
complete(urlWithParams: string): this;
completeMany(url: string): this;
completeAll(): this;
observe(urlWithParams: string): Observable<[string, Store]>;
observeMany(url: string): Observable<[string, Store]>;
observeAll(): Observable<[string, Store]>;
static ɵfac: i0.ɵɵFactoryDeclaration<ObserveService, [{ optional: true; }]>;
static ɵprov: i0.ɵɵInjectableDeclaration<ObserveService>;
}