NyanCAD / hipflask

A Pouch for Rum
Mozilla Public License 2.0
9 stars 0 forks source link

Hipflask: A Pouch for Rum

A ClojureScript atom interface to a PouchDB database.

Useful for making reactive rum apps that sync.

Usage

(def db (pouchdb "test"))
(put db {:_id "group/doc1" :number 1})
(put db {:_id "group/doc2" :number 1})
(def pa (pouch-atom db "group"))
(go (println (<!
  (swap! pa update-keys #{"group/doc1" "group/doc2"} update "number" inc))))

With Reagent, make sure to use a ratom as the cache.

(pouch-atom db "group" (r/atom {}))

Examples