Repository navigation
Teach RxJS with retrying requests - #37
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sixth lesson in my Angular guide: RxJS and HTTP. The feature slice is retrying requests that fail for a moment.
What shipped
retryTransientErrorsinterceptorwithInterceptors()inapp.config.ts.Lesson 06: RxJS and HTTP (
/thoughts/angular-06-rxjs)toSignalvsasyncshareReplaywithrefCountsearchAsYouTypeis the small operator behind the demo, with marble tests.Version and changelog. 1.4.5, with a matching changelog entry.
Bundle
Initial bundle went from 384.98 kB to 389.82 kB. I measured where the 4.8 kB comes from:
RxJS's timer and async-scheduler code is shared by the interceptor's backoff and the lesson's
delay, so it ends up in an eager chunk either way. Swappingdelayfortimersaved only 0.26 kB, so I kept the readable version. Headroom under the 400 kB budget is now 10 kB.Commits
Verification
appConfigproviders.ng test: 54 files, 387 tests, exit 0. They include:HttpTestingControllerwith fake timers: 5xx, status 0, the backoff schedule and giving up, 404, POSTtsc --noEmitconfigs are clean.TO-DOs for this PR