Handling data and state?

There seems to be very little guidance on how best to handle state and data in a non-trivial app.

For example, I have a mapping application that will show various locations on a map component that have been loaded from a backend API. These locations are also displayed on a separate component. In other words, I’m sharing data across different parts of my app.

What are the recommended ways to handle state in Ionic/Angular apps? I’ve seen ngrx mentioned a few times and it seems powerful, but it’s not mentioned in either the Angular docs or the Ionic docs.

Are there any recommended approaches by either library, or is ngrx the go-to?

In the very first intro tutorial to Angular:

Services are a great way to share information among classes that don’t know each other.


What other guidance would you need and where else would you expect to find it?

Start with:


Some sample ngrx code:


Like this:

Like this:


Thanks robinyo, those links are very helpful

To follow on, for anyone who comes across this post with the same uncertainty, here are some great blog posts on a sensible “observable data service” pattern that helps manage data in non-trivial application that rely on external data sources: