@fto-consult/expo-ui
Version:
Bibliothèque de composants UI Expo,react-native
16 lines (13 loc) • 460 B
JavaScript
import { readAsStringAsync } from "./utils";
import { loadAsset } from "../Assets/utils";
export * from "./utils";
export const readFileAsText = async (asset)=>{
return await new Promise((resolve,reject)=>{
loadAsset(asset).then((a)=>{
readAsStringAsync(a.localUri).then((data) => {
resolve(data);
}).catch(reject);
}).catch(reject);
})
}
export const readFile = readFileAsText;