~/lightning

Use-Case: Operator replyWhen from Rx.JS Illustrated with an Angular App Embedded via IFRAME

LightninginRussianat JavaScript fwdays'18 · on Sunday, 2018-03-18· [reactive-programming, angular]

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

  1. 0:00RxJS in Angular IFRAME
  2. 2:09Token expiration IFRAME
  3. 5:24Observables vs Promises
  4. 7:14Handling non-401 errors
  5. 8:20Retry with retryWhen
  6. 9:47Refresh token logic
  7. 10:51Updating tokens
  8. 11:34Final implementation
  9. 12:16Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.