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.

11 lines
355 B

import AsyncStorage from "@react-native-async-storage/async-storage";
import { City } from "../data/stub";
export const storeFavoriteCity = async (city: City | null) => {
try {
const cityJson = JSON.stringify(city)
await AsyncStorage.setItem('favorite_city', cityJson);
} catch (e) {
console.log("An error occurred", e);
}
}