Rules of Thumb
Last updated
Last updated
Consider
Service with Behavior Subject
Container Presenter
Easy upgrade path to NgRx
Interacts with the store
Pass observable streams via async pipe
Receive events from child presenter components
Decide what to do with events/data
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