Search code examples
angularionic-frameworkngrx

Should I use Ngrx in Ionic 5?


I have few concerns when using ngrx in mobile app with Ionic 5:

  1. Performance issues on mobile devices. = ngrx is state management so all data from API will be stored in memory and accessible all the time. Could this effect some older devices(e.g. android 4.4)?

  2. Too much ngrx boilerplate can increase app bundle size.

  3. Can't use ngrx/data due to a lot of limitations..

  4. ngrx is 3rd party library. Is it 100% compatible with Ionic Angular?

Is there anyone out there who has faced the similar issues?


Solution

  • I've used Ionic, I'm using NgRx in Angular projects but never needed to use them together.

    Yet, I believe it is a good choice (quite recommended) to use NgRx for state management in an Ionic-Angular project.

    1. Nowadays, devices have enough resources to handle an NgRx store state management just as React Native apps use Redux, so I wouldn't worry about that.
    2. Depending on the complexity of your app it can increase the bundle size, but not in a critical manner, especially if the build is treeshakeable
    3. can't share an opinion over this
    4. yes it is. You can check this article to get an insight