Socket
Socket
Sign inDemoInstall

async-retry

Package Overview
Dependencies
3
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1 to 0.2.0

3

build/lib/index.js

@@ -32,4 +32,7 @@ 'use strict';

var onError = function onError(err) {
if (err.bail) return bail(err);
if (!op.retry(err)) {
reject(op.mainError());
} else if (opts.onRetry) {
opts.onRetry(err);
}

@@ -36,0 +39,0 @@ };

7

History.md
0.2.0 / 2016-05-30
==================
* index: implement `onRetry` [@rauchg]
0.1.1 / 2016-02-29

@@ -11,3 +16,1 @@ ==================

* initial release
{
"name": "async-retry",
"version": "0.1.1",
"version": "0.2.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "./build/lib/index",

@@ -12,3 +12,3 @@ # async-retry

export default async function getSomething () {
const res = await retry(async (bail) => {
return await retry(async (bail) => {
// if anything throws, we retry

@@ -45,2 +45,3 @@ const res = await fetch('https://google.com');

* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`.
* `onRetry`: an optional `Function` that is invoked after a new retry is performed. It's passed the `Error` that triggered it as a parameter.

@@ -47,0 +48,0 @@ ## Credits

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc