AngularFire

NgRx without the Reducers

David East - Author
David East
Developer Advocate for Firebase.

How do I use

AngularFire with NgRx?

NgRx

Mental

Boilerplate

How do I keep from adding to this mess?

Random childhood story

"Instead of trying to memorize how to plug the pieces together you need to learn the underlying concepts. Then you'll be able to solve any problem."

Learn the concepts behind

AngularFire and NgRx

A Platform for building

Building what?

Awesome stuff.

firebase.google.com

https://github.com/angular/angularfire2

Promise or Callback

to

Observable

State Management

for Remote Data

Why don't we just dispatch

state changes to the store?

Just adds to the

mental boilerplate

AngularFirestore — Remote State Management

NgRx Store — General State Management

Redux in disguise

Say hello to AngularFireRedux*

Experimental, not production

No reducers

No reducers

Baked-in actions

We've solved it!

What about local state?

Single Responsibility

Single Responsibility

AngularFirestore — Remote state

Single Responsibility

AngularFirestore — Remote state

NgRx Store — Local state

How do I use

AngularFire with NgRx?

Don't duplicate responsibility

Don't duplicate responsibility

Use create reducers for storing remote state

Don't duplicate responsibility

Don't create reducers for storing remote state

Use the baked-in actions to dispatch remote state

Don't duplicate responsibility

Don't create reducers for storing remote state

Use the baked-in actions to dispatch remote state

Use the NgRx Store for local state.

Give it a spin.

AngularFireRedux

Thank you!