Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backoff-rxjs

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backoff-rxjs - npm Package Compare versions

Comparing version 6.1.1 to 6.1.2

2

dist/observable/intervalBackoff.d.ts

@@ -1,2 +0,2 @@

import { Observable, SchedulerLike } from "rxjs";
import { Observable, SchedulerLike } from 'rxjs';
export interface IntervalBackoffConfig {

@@ -3,0 +3,0 @@ initialInterval: number;

@@ -12,3 +12,3 @@ "use strict";

if (scheduler === void 0) { scheduler = rxjs_1.asyncScheduler; }
var _a = typeof config === "number" ? { initialInterval: config } : config, initialInterval = _a.initialInterval, _b = _a.maxInterval, maxInterval = _b === void 0 ? Infinity : _b, _c = _a.backoffDelay, backoffDelay = _c === void 0 ? utils_1.exponentialBackoffDelay : _c;
var _a = typeof config === 'number' ? { initialInterval: config } : config, initialInterval = _a.initialInterval, _b = _a.maxInterval, maxInterval = _b === void 0 ? Infinity : _b, _c = _a.backoffDelay, backoffDelay = _c === void 0 ? utils_1.exponentialBackoffDelay : _c;
initialInterval = (initialInterval < 0) ? 0 : initialInterval;

@@ -15,0 +15,0 @@ return rxjs_1.of(0, scheduler).pipe(

import { Observable } from 'rxjs';
export interface RetryBackoffConfig {
initialInterval: number;
maxAttempts?: number;
maxRetries?: number;
maxInterval?: number;

@@ -6,0 +6,0 @@ shouldRetry?: (error: any) => boolean;

@@ -15,5 +15,11 @@ "use strict";

function retryBackoff(config) {
var _a = (typeof config === 'number') ? { initialInterval: config } : config, initialInterval = _a.initialInterval, _b = _a.maxAttempts, maxAttempts = _b === void 0 ? Infinity : _b, _c = _a.maxInterval, maxInterval = _c === void 0 ? Infinity : _c, _d = _a.shouldRetry, shouldRetry = _d === void 0 ? function () { return true; } : _d, _e = _a.backoffDelay, backoffDelay = _e === void 0 ? utils_1.exponentialBackoffDelay : _e;
return function (source) { return source.pipe(operators_1.retryWhen(function (errors) { return errors.pipe(operators_1.concatMap(function (error, i) { return rxjs_1.iif(function () { return i < maxAttempts && shouldRetry(error); }, rxjs_1.timer(utils_1.getDelay(backoffDelay(i, initialInterval), maxInterval)), rxjs_1.throwError(error)); })); })); };
var _a = typeof config === 'number' ? { initialInterval: config } : config, initialInterval = _a.initialInterval, _b = _a.maxRetries, maxRetries = _b === void 0 ? Infinity : _b, _c = _a.maxInterval, maxInterval = _c === void 0 ? Infinity : _c, _d = _a.shouldRetry, shouldRetry = _d === void 0 ? function () { return true; } : _d, _e = _a.backoffDelay, backoffDelay = _e === void 0 ? utils_1.exponentialBackoffDelay : _e;
return function (source) {
return source.pipe(operators_1.retryWhen(function (errors) {
return errors.pipe(operators_1.concatMap(function (error, i) {
return rxjs_1.iif(function () { return i < maxRetries && shouldRetry(error); }, rxjs_1.timer(utils_1.getDelay(backoffDelay(i, initialInterval), maxInterval)), rxjs_1.throwError(error));
}));
}));
};
}
exports.retryBackoff = retryBackoff;
{
"name": "backoff-rxjs",
"version": "6.1.1",
"version": "6.1.2",
"description": "A collection of helpful RxJS operators to deal with backoff strategies (like exponential backoff)",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc