INNER CODE UNIT · TypeScript

EXPOFSreadwrite

mowispace/react-native-logs · src/transports/fileAsyncTransport.ts:62

const EXPOFSreadwrite = async () => {
  if (EXPOqueue.length === 0) return;

  EXPOelaborate = true;
  const item = EXPOqueue[0];

  try {
    const prevFile =
      (await item.FS.readAsStringAsync(item.file).catch(() => "")) || "";
    const newMsg = prevFile + item.msg;
    await item.FS.writeAsStringAsync(item.file, newMsg);
  } catch (error) {
    console.error("Failed to write log to file (expo legacy):", error);
  } finally {
    EXPOelaborate = false;
    EXPOqueue.shift();
    if (EXPOqueue.length > 0) {
      EXPOFSreadwrite().then();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…