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/<!
This commit is contained in:
Florian Schroedl
2026-04-16 20:05:08 +02:00
parent fffd934262
commit 973b079ae3
9 changed files with 360 additions and 321 deletions

13
tasks/todo.md Normal file
View File

@@ -0,0 +1,13 @@
# Replace core.async with promesa
## Tasks
- [x] 1. Add `funcool/promesa` to deps.edn, remove `core.async`
- [x] 2. Update `store.cljc` docstring (returns promises, not channels)
- [x] 3. Rewrite `store/memory.cljc` — return `(p/resolved val)`
- [x] 4. Rewrite `store/idb.cljs` — wrap IDB callbacks in `(p/create ...)`
- [x] 5. Rewrite `sync.cljc` — return promises from pull!/push!/fetch-transit
- [x] 6. Rewrite `core.cljc` — promises + timer-based sync loop
- [x] 7. Update `test/core_test.clj``deref` promises instead of `<!!`
- [x] 8. Update `example/todomvc/todomvc.cljs``p/let` instead of `go`/`<!`
- [x] 9. Run tests — 28 tests, 87 assertions, 0 failures