Redux: remove large lists from the store when not in use

Is it better to delete large arrays of objects from the store when the user is not using them?

eg:

The Book List container component loads a large array of book objects into the repository under the {books} key.

When the user navigates to another component of the container, say, a β€œmovie list”, which also loads a large array, this time of films. Is it better to delete the book list to save memory / performance? since the user can never visit the "book list" again ..?

  • Considerations will be mobile and older desktops?
+4
source share
1 answer

If saving to memory does not cause problems during testing, I did not delete the data from the state .

Even with several thousand entries in the list, memory usage should not cause any problems, and performance loss will be minimal if you do not, for example. copy the array during each state change.

Performance acceleration / delay caused by constantly reloading data from your backend will have a more negative impact on the user interface. You should also consider bandwidth usage, especially for mobile users.

, , , .

+2

All Articles