Comments (3)
I think your problem is that myPromise(data)
is returning a promise instead of a function which returns a promise, so you are ending up with something like the following:
const result = await pRetry(yourPromise, { retries: 5 })
In the above, by the time pRetry
is called, the return value of the previous promise is propagated through the .then
chain. In this case, attemptNumber
is returned as you observed. If you do not pass a function argument to then
, it will be ignored.
So, the answer to your question is yes given the input you provided to p-retry
.
from p-retry.
thank you @acostalima 🍻
from p-retry.
@sindresorhus I think you can close this since the behavior reported is due to misuse.
from p-retry.
Related Issues (20)
- how to stop retry on SIGINT HOT 1
- Use with sinon fake timers HOT 1
- Firefox doesn't retry on TypeError: NetworkError
- Add support for AbortSignal HOT 1
- require/import('p-retry') example for 5.0.0 HOT 1
- Package p-retry has been ignored because it contains invalid configuration HOT 2
- How can I use this on node? There is no cjs export of the library HOT 1
- Check for infinity value in `retries` HOT 2
- Allow wrapping function like `mem` does HOT 2
- SyntaxError: Cannot use import statement outside a module HOT 1
- Backport AbortController to 4.x HOT 1
- No longer useable via TypeScript due to @types/retry dependency release HOT 11
- The documentation of `onFailedAttempt(error)` is incorrect and misleading.
- Support `error.timeout_duration` for `onFailedAttempt`. HOT 2
- Allow importing using require HOT 1
- Ability to customize whether an error should be retried HOT 3
- Remove the signal.onabort listener when finished
- Retry undici network errors on 4.x HOT 2
- Extract `isNetworkError` to own module? HOT 1
- Add support for CommonJS Modules HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p-retry.