Local-first sync: on-device store + offline mutation queue, idempotent server upserts
All checks were successful
Build & Release APK / build (push) Successful in 10m54s

Screens render synchronously from an AsyncStorage-backed store; every
mutation applies locally and drains to the API in the background
(last-write-wins, client-generated UUIDs). Sydney round-trips are off the
interaction path and the app works fully offline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-07 19:19:51 -07:00
parent 4d6031d007
commit ad16522461
13 changed files with 417 additions and 216 deletions

8
app/src/lib/useStore.ts Normal file
View File

@@ -0,0 +1,8 @@
import { useSyncExternalStore } from "react";
import { getState, subscribe, type State } from "./store";
// Subscribe a component to the local-first store. The whole state object is
// the snapshot (replaced immutably on every change), so derive lists inline.
export function useStore(): State {
return useSyncExternalStore(subscribe, getState, getState);
}