UNPKG

ngx-http-request-state

Version:

Angular library for wrapping HttpClient responses with loading & error information to allow observing load/loading/error state changes as a stream of events.

17 lines (16 loc) 925 B
import { HttpResponse } from '@angular/common/http'; import { Observable } from 'rxjs'; import { HttpRequestState } from './model'; export declare function httpRequestStates<T>(): (source: Observable<HttpResponse<T> | T>) => Observable<HttpRequestState<T>>; /** * * @param mapResponse a function to map from HttpResponse<T> to K * @deprecated use rxjs's map() operator to transform the response prior to using httpRequestStates() instead. */ export declare function httpRequestStates<T, K>(mapResponse: (result: HttpResponse<T>) => K): (source: Observable<HttpResponse<T>>) => Observable<HttpRequestState<K>>; /** * * @param mapResponse a function to map from T to K * @deprecated use rxjs's map() operator to transform the value prior to using httpRequestStates() instead. */ export declare function httpRequestStates<T, K>(mapResponse: (result: T) => K): (source: Observable<T>) => Observable<HttpRequestState<K>>;