Refactoring from Callback Hell to Observables – Live Coding in TS
summary
Live-coding refactors an Angular7 TypeScript app from nested callbacks into chained promises, async/await and then observables, replacing paired HTTP subscribes with forkJoin and Promise.all, converting observables with toPromise when needed. Builds cascading combo boxes (user -> countries -> cities -> stores), fixes the bug where changing city didn’t reload stores, and implements a submit flow that validates a receipt, shows a confirmation dialog and waits for the button click via ViewChild-bound promise before posting the coupon. Also generates DTOs from Swagger JSON to keep client/server types in sync.
AI-written summary · about
chapters (16)
- 0:00Refactoring with Observables
- 1:47Speaker background and community work
- 3:20Async challenges in JS
- 4:25Live coding setup
- 8:01API docs and codegen
- 12:33Callback hell to Observables
- 15:25Extracting duplicate methods
- 17:54Removing unused params
- 20:28Fixing city selection bug
- 20:55Simplifying user flows
- 27:04Async/await with Promises
- 30:16Promises vs callback hell
- 33:29Clean async best practices
- 34:54Promises vs Observables
- 38:59Summary
- 39:40Q&A








