ngrx-workshop
Search…
Rules of Thumb

You probably don't need NgRx

  • Consider
    • Service with Behavior Subject
    • Container Presenter
    • Easy upgrade path to NgRx

Container/Presenter

Container

  • Interacts with the store
  • Pass observable streams via async pipe
  • Receive events from child presenter components
  • Decide what to do with events/data

Presenter

  • Receive plain data from parent
  • Display data/make it pretty
  • User/system events are raised to parent via emitters
    • Decisions are deferred
    • Component is reusable and flexible
  • No knowledge of stores, services, selectors, actions, etc.
Refactor Tour of Heroes to use Container Presenter https://stackblitz.com/github/jessesanders/tour-of-heroes
Copy link
On this page
You probably don't need NgRx
Container/Presenter
Container
Presenter