Download mobile/src/effects/screenshotPersistenceQueue.ts from Anirudh1950/MentraOS: direct link, hf CLI and curl.
- Browser
- Download file 453 Bytes
-
https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/src/effects/screenshotPersistenceQueue.ts
- Command line
-
hf download hf://Anirudh1950/MentraOS/mobile/src/effects/screenshotPersistenceQueue.ts
-
curl -L -o screenshotPersistenceQueue.ts https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/src/effects/screenshotPersistenceQueue.ts
453 Bytes
| let persistenceTail: Promise<void> = Promise.resolve() | |
| /** | |
| * Serialize screenshot file writes, URI updates, and cleanup. Capture itself | |
| * stays concurrent so gesture handlers still begin it synchronously. | |
| */ | |
| export function enqueueScreenshotPersistence<T>(task: () => Promise<T>): Promise<T> { | |
| const result = persistenceTail.then(task) | |
| persistenceTail = result.then( | |
| () => undefined, | |
| () => undefined, | |
| ) | |
| return result | |
| } | |