Files
App/api/query-functions/storage.ts
T
2024-10-13 17:29:44 -05:00

14 lines
387 B
TypeScript

import AsyncStorage from "@react-native-async-storage/async-storage"
import { AsyncStorageKeys } from "../../enums/async-storage-keys"
import _ from "lodash";
export const fetchServerUrl : () => Promise<string> = async () => {
let url = await AsyncStorage.getItem(AsyncStorageKeys.ServerUrl)!;
if (_.isNull(url))
throw Error("Server URL was null")
return url;
}