Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
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.
@http-ext/plugin-retry
Advanced tools
Readme
A retry plugin for HttpExt.
This plugin retries failed network requests using a configurable back-off strategy.
The plugin requires @http-ext/core
and @http-ext/angular
to be installed.
yarn add @http-ext/plugin-retry
or
npm install @http-ext/plugin-retry
The whole configuration object is optional.
import { HttpExtModule } from '@http-ext/angular';
import { createRetryPlugin } from '@http-ext/plugin-retry';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
HttpClientModule,
HttpExtModule.forRoot({
plugins: [createRetryPlugin()]
})
],
bootstrap: [AppComponent]
})
export class AppModule {}
You can give a partial configuration object it will be merged with default values.
Property | Type | Default value | Description |
---|---|---|---|
initialIntervalMs | number | 300 | Duration before the first retry. |
maxIntervalMs | number | 10_000 | Maximum time span before retrying. |
maxRetries | number | 3 | Maximum number of retries. |
shouldRetry | RetryPredicate | isServerOrUnknownError | Predicate function to know which failed request should be retried. |
shouldHandleRequest | RequestCondition | () => true | Predicate function to know which request the plugin should handle. |
Here is an example passing a configuration object.
Keep in mind that HTTP error is not emitted while the plugin is retrying. In the following example the HTTP error will be emitted after 10 retries, then the observable completes.
import { MemoryStorage } from '@http-ext/plugin-cache';
@NgModule({
imports: [
HttpExtModule.forRoot({
plugins: [
createRetryPlugin({
initialIntervalMs: 500,
maxIntervalMs: 20_000,
maxRetries: 10,
shouldRetry: response => response.status !== 404,
shouldHandleRequest: ({ request }) =>
request.url.includes('api.github.com')
})
]
})
]
})
export class AppModule {}
FAQs
> A retry plugin for [HttpExt](https://github.com/jscutlery/http-ext).
The npm package @http-ext/plugin-retry receives a total of 9 weekly downloads. As such, @http-ext/plugin-retry popularity was classified as not popular.
We found that @http-ext/plugin-retry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
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.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.