0

I have an angular 7 application which uses NGRX store. The application has 20 modules with Search page & CRUD pages. The modules are lazy-loaded. The NGRX state holds the data that is displayed/entered in the page. As the user visits multiple pages in multiple modules, the size of the NRGX store keeps increasing.

I would like to know if there are any techniques on how to handle the size of NGRX store efficiently so as to maintain the size of store to an optimum limit.

Would like to hear all possible options for this.

GokuSS3
  • 123
  • 1
  • 11
  • Only store necessary data that is being used cross-components in the store. I noticed that there are a lot of practices that literally spam the reducer with everything just for 'consistency' – Gabriel George Oct 08 '20 at 07:01
  • @GabrielGeorge: But doesn't that mean we would use NGRX for some components and not use for other, meaning an architectural inconsistency in the application ? – GokuSS3 Oct 08 '20 at 10:09
  • @GabrielGeorge: Also my angular app follows Smart & dummy component model wherein the shared components will be dummy ones which will just be used to display data in UI. How to share data across components in my scenario ? – GokuSS3 Oct 08 '20 at 13:40
  • In your case, using reducer is fine I reckon. Did you have to transform data coming back from the API? – Gabriel George Oct 08 '20 at 22:15
  • Yes, we are transforming data from API to display in UI. – GokuSS3 Oct 09 '20 at 09:49

0 Answers0