~/talk

How to use NgRx ComponentStore?

Talkat NG-DE Conference 2022 · 2022-10-06..10-07· [angular, frontend-architecture]
slides:none on file

ComponentStore is a tiny standalone state library (one file, 392 lines) that settles three needs: read via select/update/effect/updater, write via updaters, and side effects with explicit race control using concatMap/mergeMap/switchMap/exhaustMap. Four concrete use cases are demonstrated: singleton providedIn: 'root', reusable common component stores (paginator), local component state, and branch-level shared state. Example app uses Google Books API, shows searching, pagination (513 results example), and works end-to-end while keeping lifecycle and subscriptions tied to component providers.

AI-written summary · about

  1. 0:00Introduction and survey
  2. 3:57What is ComponentStore
  3. 10:45Reading and writing state
  4. 12:13Handling side effects with effects
  5. 17:33Four use cases for ComponentStore
  6. 23:16Singleton state example
  7. 25:28Common component state example
  8. 28:41Local component state example
  9. 30:08Component branch state example
  10. 31:10State flow in the app
  11. 35:50Resources and closing
~/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.