-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(retry): add config to reset error count on successful emission #4683
Conversation
The build is failing✨ Good work on this PR so far! ✨ Unfortunately, the Travis CI build is failing as of fb7bb58. Here's the output:
|
fb7bb58
to
c4d20c0
Compare
Pull Request Test Coverage Report for Build 8312
💛 - Coveralls |
@cartant said we can have this. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay... I think we're almost there. Here's what I think we should do though... instead of having two arguments, we have it take either a number or a config object like so:
retry(); // retry forever
retry(5); // retry five times
retry({ count: 5 }); // retry five times
retry({ count: 5, resetOnSuccess: true }); // retry five times, but reset the counter on success
retry{{ resetOnSuccess: true }); // This is the same thing as just retry() lol
Something to consider (breaking changes aside ): I think that |
This PR adds the ability to reset the error counter on successful emissions using the `retry` operator. The current behavior for `retry(n)` is to call error if n errors occurred, regardless of whether or not they were consecutive. Now one would be able to use `retry(n, true)` to have the count reset so that only n consecutive errors will cause the observable to fail.
added overloaded signature to the `retry` operator that accepts a config object
c4d20c0
to
8815014
Compare
@benlesh ping, I made the suggested changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of small things.
@benlesh ping |
This PR adds the ability to reset the error counter on successful emissions using the
retry
operator.
Description:
The current behavior for
retry(n)
is to call error if n errors occurred, regardless ofwhether or not they were consecutive. Now one would be able to use
retry(n, true)
to have thecount reset so that only n consecutive errors will cause the observable to fail.