Commit Graph

2 Commits

Author SHA1 Message Date
Florian Schroedl
973b079ae3 refactor: replace core.async with promesa for all async operations
- Store protocol now returns promesa promises instead of core.async channels
- MemoryStore: `(p/resolved val)` replaces chan+put!+close! ceremony
- IDBStore: `p/create` with resolve/reject wraps IDB callbacks
- sync.cljc: CLJ uses `p/vthread`, CLJS returns native Promise chains
- core.cljc: `p/let` replaces go blocks, timer-based sync loop replaces
  go-loop+alts!, debounced push replaces kick channel
- Tests use `deref` with timeout on promesa promises
- Todomvc example uses `p/let` instead of go/<!
2026-04-16 20:05:08 +02:00
Florian Schroedl
86b54e1291 refactor: extract shared .cljc library with store protocol
Move core, sync, and transit from platform-specific .clj/.cljs to
shared .cljc files with reader conditionals. This enables testing
the full sync logic on the JVM and using SyncedAtom from Clojure
clients.

Key changes:
- PStore protocol (store.cljc) decouples core from storage backend
- IDB store (store/idb.cljs) and memory store (store/memory.cljc)
- SyncedAtom implements CLJ IDeref/IAtom/IRef + CLJS equivalents
- Sync client uses java.net.http on CLJ, fetch on CLJS
- SSE remains CLJS-only; JVM clients use polling
- API change: store passed explicitly instead of pb/open
- 7 new JVM tests: local ops, persistence, watches, two-client sync
- 28 tests total, 87 assertions, all passing
2026-04-16 19:42:06 +02:00