I my last two articles I introduced React Native app development with F# and showed how we can do HTTP calls with the Fetch API . I also mentioned briefly how to access the local storage of your phone in order to cache information. In this article I want to look a small bit deeper into this.
AsyncStorage is a simple, unencrypted, asynchronous, persistent, key-value storage system that is global to the app. It should be used instead of LocalStorage. [ project site ]
AsyncStorage only provides a very basic key-value store. With the help of fable-react-native-simple-store we get something that allows us to store objects in arrays separated by type:
This is still a very low level data storage API, but as the sample app shows it’s already useful for caching specific app data.