I have an array of around 4000 to 5000 objects that I need to work with throughout the life cycle of my angular app. I use ngrx for state management in this app and would load this data using an effect with the startWith operator. I was wondering how big is too big for an array of objects to be loaded and stored in state in this way.
It will really depends what's in your array, and what you plan to do with it. An array itself can contains a lot of values before it has any impact on your app.
But if you've got an array containing a humongous amount of values, here's my advice:
Set
containing all those people (only references to them)trackBy
on your list with your *ngFor
and also changeDetectionStrategy: ChangeDetectionStrategy.OnPush`I've already tried to see if an app could handle 100K items and the answer is yes, even though it started to feel slightly unresponsive sometimes. So 4 or 5k should be all good following the information above.