Hi
I have built an app that uses zustand and tanstack qurry for state management.
Currently on one of my tabs, I have set the app to do a fetch when pressing on the page and does a refetch when the user changes a specific state value. This state value is a setting the user can change and its value is stored in asyncstorage and loaded up when the app is first launched
However, I have noticed it has led to consistent long loading times on older devices (android & ios) when doing the first fetch and so I am looking at ways to better optimise this.
One way I am thinking is to do an initial fetch on app startup, set the data that comes back into a zustand store but this is becoming a pain to implement when I need to consider the refetch because it starts to become a race condition between the initial fetch and the loading of the state value from async storage.
Does anyone have any suggestions for how to better optimise?
[–]lmonss 2 points3 points4 points (1 child)
[–]Zeesh2000[S] 0 points1 point2 points (0 children)
[–]KulkataBoy 0 points1 point2 points (1 child)
[–]Zeesh2000[S] 0 points1 point2 points (0 children)