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 0.0.2 to 0.0.3

dist/observable/intervalBackoffExponential.d.ts

2

dist/index.d.ts
export { retryBackoffExponential, RetryBackoffExponentialConfig } from './operators/retryBackoffExponential';
export { intervalExponential, IntervalExponentialConfig } from './observable/intervalExponential';
export { intervalBackoffExponential, IntervalBackoffExponentialConfig } from './observable/intervalBackoffExponential';
export { retryBackoffExponential } from './operators/retryBackoffExponential';
export { intervalExponential } from './observable/intervalExponential';
export { intervalBackoffExponential } from './observable/intervalBackoffExponential';
{
"name": "backoff-rxjs",
"version": "0.0.2",
"version": "0.0.3",
"description": "A collection of helpful RxJS operators to deal with backoff strategies (like exponential backoff)",

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

# backoff-rxjs
A collection of helpful RxJS operators to deal with backoff strategies (like exponential backoff)
## intervalExponential
![Basic interval Exponential](./intervalExponentialBasic.svg)
`intervalExponential` works similiarly to `interval` except that it doubles the delay between emissions every time.
| name | type | attirbute | description |
| ------------- |-------------| -----| ---------------|
| config | [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) \| [IntervalExponentialConfig](https://github.com/alex-okrushko/backoff-rxjs/blob/277fbbbde4b046733070e2ed64e0b765699fb66b/src/observable/intervalExponential.ts#L6)| required |Can take number as initial interval or a config with initial interval and optional max Interval |
`intervalExponential` is especially useful for periodic polls that are reset whenever user activity is detected:
```ts
fromEvent(document, 'mousemove').pipe(
// There could be many mousemoves, we'd want to sample only
// with certain frequency
sampleTime(LOAD_INTERVAL_MS),
// Start immediately
startWith(null),
// Resetting exponential interval
switchMapTo(intervalExponential({initialInterval: LOAD_INTERVAL_MS, maxInterval: MAX_INTERVAL_MS})),
);
```
## retryExponentialBackoff
![Retry Backoff Exponential Image](./retryBackoffExponential.svg)
| name | type | attirbute | description |
| ------------- |-------------| -----| ---------------|
| config | [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) \| [IntervalExponentialConfig](https://github.com/alex-okrushko/backoff-rxjs/blob/277fbbbde4b046733070e2ed64e0b765699fb66b/src/observable/intervalExponential.ts#L6)| required |Can take number as initial interval or a config with initial interval and optional max Interval |
export {retryBackoffExponential, RetryBackoffExponentialConfig} from './operators/retryBackoffExponential';
export {intervalExponential, IntervalExponentialConfig} from './observable/intervalExponential';
export {intervalBackoffExponential, IntervalBackoffExponentialConfig} from './observable/intervalBackoffExponential';
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