Files
atomsync/example
Florian Schroedl 78b897cc25 feat: add Connection API and make SyncedAtom a promise
Add `connect` to manage store + shared config, and `synced-atom` now
accepts a Connection or raw store (backwards compatible).

SyncedAtom implements IPromiseFactory so it works directly with p/let:
  (def conn (pb/connect {:db "my-app" :server "..."}))
  (def !todos (pb/synced-atom conn "todo"))
  (p/let [todos !todos] (swap! todos assoc "k" v))

- Connection record holds store-promise + default opts (server, interval)
- `connect` accepts :store (CLJ/CLJS) or :db (CLJS, opens IndexedDB)
- `ready?` now resolves to the SyncedAtom itself instead of `true`
- Add `close!` to close a Connection's store
- Store field is now an atom (set when store-promise resolves)
- Simplify TodoMVC example: no more !conn atom or double-deref
2026-04-18 16:51:09 +02:00
..