Use-Case: Operator replyWhen from Rx.JS Illustrated with an Angular App Embedded via IFRAME
summary
Shows how to use RxJS retryWhen to refresh access tokens for an Angular app running inside an IFRAME that communicates via window.postMessage. It explains differentiating 401 token errors from other HTTP errors, calling a backend refresh with a 2s timeout, falling back to the parent app for credentials, and using a Subject to retrigger the original HTTP GET so existing subscribers are preserved—implemented in about twenty lines of orchestration code.
AI-written summary · about
chapters (9)
- 0:00RxJS in Angular IFRAME
- 2:09Token expiration IFRAME
- 5:24Observables vs Promises
- 7:14Handling non-401 errors
- 8:20Retry with retryWhen
- 9:47Refresh token logic
- 10:51Updating tokens
- 11:34Final implementation
- 12:16Q&A
related talks
58mAngular and The Case for RxJS
45mReactive Frontends with RxJS and Angular
36mRxJS Recipes
01h 07mReactive Frontends with RxJS and Angular - Sergi Almar
47mCool RxJS Tricks
36mComplex Features Made Easy With RxJS
30mRxJS in React, RxJS in Angular and Why We Should All Be Friends
41mRxJS Advanced Patterns Learn how to manage heavily dynamic Angular apps
