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

Function flushAllWrites

packages/app-expo/src/stores/persist.ts:66–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64}
65
66export async function flushAllWrites(): Promise<void> {
67 for (const [key, timer] of pendingWrites.entries()) {
68 clearTimeout(timer);
69 pendingWrites.delete(key);
70 const data = pendingData.get(key);
71 pendingData.delete(key);
72 if (data !== undefined) {
73 const promise = writeToFS(key, data);
74 writePromises.set(key, promise);
75 promise.finally(() => writePromises.delete(key));
76 }
77 }
78 await Promise.all(writePromises.values());
79}
80
81export function withPersist<T extends object>(
82 key: string,

Callers 1

main.tsxFile · 0.90

Calls 3

writeToFSFunction · 0.70
deleteMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected