feat(retry): add config to reset error count on successful emission#4683
feat(retry): add config to reset error count on successful emission#4683omermizr wants to merge 3 commits intoReactiveX:masterfrom
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. 👍 |
benlesh
left a comment
There was a problem hiding this comment.
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 |
benlesh
left a comment
There was a problem hiding this comment.
Just a couple of small things.
|
@benlesh ping |
This PR adds the ability to reset the error counter on successful emissions using the
retryoperator.
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.