Version: datastore-0.5.0
React Native - using Datastore for Mobile
Offix Datastore provides support for indexeddb
by default.
When using datastore in React Native is necessary to override the default storage and network implementations.
#
StorageThe Datastore provides an SQLite adapter out of the box. In order to enable this storage options can be passed as the second paramater to the datastore constructor.
#
Network StatusSince the default implementation relies on the browser window.navigator
for network connectivity, it is necessary to provide an implementation of the NetworkStatus
interface for native application. This can be done with Capacitor or @react-native-community/netinfo for React Native.
This can then be provided as in the config for the Datastore