Sharing logic & state between universal web and mobile apps
summary
Argues for sharing business logic and client state between web and mobile by packaging hooks and API adapters into a monorepo and running session-like state on the edge. Demo uses a shared useSearch hook and context across Expo (mobile) and Next (web), a type-safe worker-functions SDK that calls Cloudflare Workers + D1, and a turbo repo/NX layout. Clearing search history persists to the edge and appears synced on reload; websockets are proposed for real-time updates.
AI-written summary · about
chapters (8)
- 0:00Introduction and visa story
- 3:50Universal apps and React Native
- 6:12Sharing business logic and config
- 8:58API layers and adapters
- 10:24App state and context
- 12:29Demo sharing logic
- 16:01Demo syncing state with edge
- 26:39Recap and closing








