Skip to content
loading...

Redux with Observable Stores in Angular

Steve Belovarich on May 02, 2019

It's turning out that 2019 is the year of the Observable store at ng-conf with several speakers advocating for this pattern in Angular apps. I rec... [Read Full]
markdown guide
 

map((a: AbstractAction) => this.reducer(this.state, a))
this.state should be this.getState()

 

Yes, this is a good call and how I actually implemented it. I think I used this.state merely as a clear example in the write up.

 

No worries, just left it as a note in case another reader was wondering 😊

 

This is some good stuff. Thanks for this insight. I have implemented a simple store with BehaviorSubject before. But your implementation is such more clearer and cleaner. Thanks again for the post.

 

I've used Observable.store in 2 in my freelance projects. Really love the simplicity it offered.

 

Hello.
I love this great article.
But, I got a question.

When should I use state?

get state(): AbstractState {
return this._state$.getValue();
}

Template should not consume store.state?

 

In this simple expression of an Observable store you can do something like this in a template.

{{ (store.state$ | async).chunk }}

 
 

Great read, thanks. I've never been a fan of ngrx and I've worked with BehaviourSubjects before as well. A very nice way of implementing this pattern.

 

I've missed something. what is AbstractAction ?

 

AbstractAction is a placeholder interface for actions, which you can override with another interface that more clearly defines the action in any class that extends the Store class.

code of conduct - report abuse