ngrx-workshop
  • Table of Contents
  • Setup and Configuration
  • Rules of Thumb
  • Rules of Thumb pt2
  • NgRx Libraries
    • NgRx Data
    • NgRx Entity
    • Action Creators
    • NgRx Auto Entity
  • NgRx Facades
    • NgRx Facades
  • Testing
    • Testing Factory
    • Testing Reducers
    • Testing Selectors
    • Testing Effects
  • Advanced Actions
    • 3 Types of Actions
    • Deciders
    • Splitter Actions
    • Aggregators
  • ToDo
    • Todo
Powered by GitBook
On this page
  • You probably don't need NgRx
  • Container/Presenter
  • Container
  • Presenter

Was this helpful?

Rules of Thumb

PreviousSetup and ConfigurationNextRules of Thumb pt2

Last updated 5 years ago

Was this helpful?

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