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

polly-js

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polly-js - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

2

package.json
{
"name": "polly-js",
"version": "1.6.1",
"version": "1.6.2",
"description": "Transient exception handling",

@@ -5,0 +5,0 @@ "main": "src/polly.js",

@@ -97,4 +97,23 @@ # polly-js

Use async await with the browsers `fetch` API.
```JavaScript
const loadData = url => {
return polly()
.waitAndRetry(2)
.executeForPromise(async () => {
const rsp = await fetch(url);
if (rsp.ok) {
return rsp.json();
}
return Promise.reject(rsp);
});
};
// Using the function somewhere else:
const movies = await loadData("http://localhost:3000/movies.json");
```
## Acknowledgements
The library is based on the [Polly NuGet package](https://www.nuget.org/packages/Polly/) by Michael Wolfenden
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