asyncstorage code example
Example 1: react native storage
npm install react-native-storage
npm install @react-native-community/async-storage
Example 2: asyncstorage.getallkeys
importData = async () => {
try {
const keys = await AsyncStorage.getAllKeys();
const result = await AsyncStorage.multiGet(keys);
return result.map(req => JSON.parse(req)).forEach(console.log);
} catch (error) {
console.error(error)
}
}