MCPcopy
hub / github.com/codedogQBY/ReadAny / writeToFS

Function writeToFS

packages/app-expo/src/stores/persist.ts:45–53  ·  view source on GitHub ↗
(key: string, data: unknown)

Source from the content-addressed store, hash-verified

43}
44
45async function writeToFS(key: string, data: unknown): Promise<void> {
46 try {
47 await ensureDir();
48 const filePath = `${STORE_DIR}/${key}.json`;
49 await FileSystem.writeAsStringAsync(filePath, JSON.stringify(data));
50 } catch (err) {
51 console.error(`Failed to persist ${key}:`, err);
52 }
53}
54
55export async function loadFromFS<T>(key: string): Promise<T | null> {
56 try {

Callers 2

debouncedSaveFunction · 0.70
flushAllWritesFunction · 0.70

Calls 1

ensureDirFunction · 0.85

Tested by

no test coverage detected