         temp-id (random-uuid)]
     (conj
       (mapv (fn [[a v]] [eid a v]) (dissoc m :db/id)))))
-      ;[temp-id :db/id eid])))
+;[temp-id :db/id eid])))
 
 ;(defrecord Todo [id title done])
 ;
 (defn todo-tx [id title done]
   (merge
-    {:db/id      id
-     :todo/title title
+    {:db/id        id
+     :todo/title   title
      :todo/visible false}
     (when-not (nil? done)
       {:todo/status done})))

  =>
  (println "Mark done via toggle complete:" ?e)
  (insert-unconditional! [?e :todo/status :done]))
 ; and todos/status :done count === num of todos

(defrule remove-toggle
  [?toggle <- :ui/toggle-complete [[e a v]] (= v true)]


@(def session (fire-rules (insert-all todos facts)))

@(def all-done (query session find-all-done))

(defn clara-tups->maps
  [tups]
  (->> (group-by :?e tups)
    (mapv (fn [[id ent]]
           (into {:db/id id}
             (reduce (fn [m tup] (assoc m  (:?a tup) (:?v tup)))
               {} ent))))))


(defn attr-ns [attr]
  (subs (first (clojure.string/split attr "/")) 1))

(cljs.pprint/pprint (clara-tups->maps all-done))


(println "Done count: " (query session find-done-count))

(println facts)

