Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
ngx-http-resilience
Advanced tools
Readme
Angular HttpInterceptor that provides resiliency capabilities
npm install ngx-http-resilience
#
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 errors$ = new Subject<HttpVisibilityInterceptorError>();
const visibilityInterceptor = createHttpVisibilityInterceptorFn({
httpEvents$,
errors$,
});
export const appConfig: ApplicationConfig = {
providers: [provideHttpClient(withInterceptors([visibilityInterceptor]))],
};
#
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 httpInterceptorProviders = [
{
provide: HTTP_INTERCEPTORS,
useValue: visibilityInterceptorService,
multi: true,
},
];
export const appConfig: ApplicationConfig = {
providers: [httpInterceptorProviders],
};
The visibility interceptor provides a stream of http events and errors. This can be used to modify an apps behaviour, such as letting a user know that there are network connectivity issues.
The retry interceptor allows for retrying failed requests. For example retrying requests that failed due to network connectivity issues.
Every retry interceptor has a retry policy, which determines:
shouldHandleRequest
)shouldHandleError
)delay
)Optionally it can also specify a:
maxRetries
)maxDuration
)Function | Service |
---|---|
| TODO |
FAQs
Angular HttpInterceptors that provide resiliency capabilities
The npm package ngx-http-resilience receives a total of 62 weekly downloads. As such, ngx-http-resilience popularity was classified as not popular.
We found that ngx-http-resilience demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.