You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
409 B

import AsyncStorage from '@react-native-async-storage/async-storage';
import { City } from '../data/stub';
import {FETCH_FAVORITE_CITY} from '../redux/constants';
export const getFavoriteCityStorage = async () => {
try {
const cityJson = await AsyncStorage.getItem('favorite_city')
return cityJson != null ? JSON.parse(cityJson) : null;
} catch(e) {
console.log("An error occurred", e);
}
}