ngx-http-resilience
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -8,2 +8,3 @@ import { HttpInterceptorFn } from '@angular/common/http'; | ||
* @param policy The retry strategy to use | ||
* @param options Additional options for the interceptor | ||
* | ||
@@ -10,0 +11,0 @@ * @example |
import { HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; | ||
import { RetryPolicy } from './types'; | ||
import { Observable } from 'rxjs'; | ||
import { RetryInterceptorEvent, RetryPolicy } from './types'; | ||
export declare class HttpRetryInterceptorService implements HttpInterceptor { | ||
private readonly interceptorFn; | ||
private readonly events$; | ||
private constructor(); | ||
static create(policy: RetryPolicy): HttpRetryInterceptorService; | ||
intercept(req: HttpRequest<unknown>, next: HttpHandler): import("rxjs").Observable<import("@angular/common/http").HttpEvent<unknown>>; | ||
intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<import("@angular/common/http").HttpEvent<unknown>>; | ||
observeEvents(): Observable<RetryInterceptorEvent>; | ||
} |
@@ -20,3 +20,3 @@ import { Observable } from 'rxjs'; | ||
* @param predicate The predicate to wrap | ||
* @param initialDisabledState The initial disabled state of the predicate, defaults to false | ||
* @param initiallyDisabled The initial disabled state of the predicate, defaults to false (enabled) | ||
* | ||
@@ -30,2 +30,2 @@ * @example | ||
*/ | ||
export declare function createDisableablePredicate(predicate: RequestPredicate, initialDisabledState?: boolean): DisableablePredicate; | ||
export declare function createDisableablePredicate(predicate: RequestPredicate, initiallyDisabled?: boolean): DisableablePredicate; |
@@ -45,2 +45,5 @@ import { HttpRequest } from '@angular/common/http'; | ||
export interface RetryInterceptorOptions { | ||
/** | ||
* An optional Subject for emitting retry events | ||
*/ | ||
events$?: Subject<RetryInterceptorEvent>; | ||
@@ -47,0 +50,0 @@ } |
{ | ||
"name": "ngx-http-resilience", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Angular HttpInterceptors that provide resiliency capabilities ", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -22,16 +22,9 @@ ![License](https://img.shields.io/github/license/ebh/ngx-http-resilience) | ||
```typescript | ||
# | ||
app.config.ts | ||
import {provideHttpClient, withInterceptors} from '@angular/common/http'; | ||
import {ApplicationConfig} from '@angular/core'; | ||
import { | ||
HttpVisibilityInterceptorError, | ||
HttpVisibilityInterceptorHttpEvent, | ||
createHttpVisibilityInterceptorFn, | ||
} from 'ngx-http-resilience'; | ||
import {Subject} from 'rxjs'; | ||
// app.config.ts | ||
import { provideHttpClient, withInterceptors } from '@angular/common/http'; | ||
import { ApplicationConfig } from '@angular/core'; | ||
import { HttpVisibilityInterceptorError, HttpVisibilityInterceptorHttpEvent, createHttpVisibilityInterceptorFn } from 'ngx-http-resilience'; | ||
import { Subject } from 'rxjs'; | ||
export const httpEvents$ = new Subject< | ||
HttpVisibilityInterceptorHttpEvent<unknown> | ||
>(); | ||
export const httpEvents$ = new Subject<HttpVisibilityInterceptorHttpEvent<unknown>>(); | ||
export const errors$ = new Subject<HttpVisibilityInterceptorError>(); | ||
@@ -51,10 +44,8 @@ const visibilityInterceptor = createHttpVisibilityInterceptorFn({ | ||
```typescript | ||
# | ||
app.config.ts | ||
import {HTTP_INTERCEPTORS} from '@angular/common/http'; | ||
import {ApplicationConfig} from '@angular/core'; | ||
import {HttpVisibilityInterceptorService} from 'ngx-http-resilience'; | ||
// app.config.ts | ||
import { HTTP_INTERCEPTORS } from '@angular/common/http'; | ||
import { ApplicationConfig } from '@angular/core'; | ||
import { HttpVisibilityInterceptorService } from 'ngx-http-resilience'; | ||
export const visibilityInterceptorService = | ||
new HttpVisibilityInterceptorService(); | ||
export const visibilityInterceptorService = new HttpVisibilityInterceptorService(); | ||
@@ -61,0 +52,0 @@ export const httpInterceptorProviders = [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156004
1467
89