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>
9 lines
361 B
TypeScript
9 lines
361 B
TypeScript
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);
|
|
}
|