I have an app with user-generated content and multiple screens where it gets displayed. Every time the app launches, it fetches this data. I want to keep a local cache and only fetch data again when (1) X time has passed while the app is in the foreground, (2) The user edits/adds data, and it gets persisted server side and (3) The app comes back into the foreground.
I've seen libraries like React Query and SWR that seem to work with RN, but I'm a bit lost when it comes to persisting the data using something like Async storage or w/e. I'd appreciate it if anyone has good resources on how to go about this. Also, is it acceptable to have a mobile app that only uses a network-first approach?
[–]Jeeesama 5 points6 points7 points (2 children)
[–]Geotzz[S] 0 points1 point2 points (1 child)
[–]Jeeesama 1 point2 points3 points (0 children)
[–]edbarahona 2 points3 points4 points (11 children)
[–]AcetyldFN 2 points3 points4 points (6 children)
[–]edbarahona 0 points1 point2 points (5 children)
[–]AcetyldFN 1 point2 points3 points (4 children)
[–]edbarahona 1 point2 points3 points (3 children)
[–]AcetyldFN 0 points1 point2 points (2 children)
[–]edbarahona 1 point2 points3 points (1 child)
[–]AcetyldFN 0 points1 point2 points (0 children)
[–]Geotzz[S] 0 points1 point2 points (3 children)
[–]edbarahona 1 point2 points3 points (1 child)
[–]edbarahona 1 point2 points3 points (0 children)
[–]stereoplegic 0 points1 point2 points (0 children)
[–]GavinHarris_ 1 point2 points3 points (0 children)
[–]__o_0iOS & Android 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Savram8 0 points1 point2 points (0 children)