 (ns takarabako.core
   (:require [konserve.memory :refer [new-mem-store]]
             [replikativ.peer :refer [client-peer]]
-            [replikativ.stage :refer [create-stage! connect!
-                                      subscribe-crdts!]]
-
+            [replikativ.stage :refer [create-stage! connect! subscribe-crdts!]]
             [hasch.core :refer [uuid]]
             [replikativ.crdt.ormap.realize :refer [stream-into-identity!]]
             [replikativ.crdt.ormap.stage :as s]


(enable-console-print!)


(def stream-eval-fns
  {'assoc (fn [a new]
            (swap! a assoc (uuid new) new)
            a)
   'dissoc (fn [a new]
             (swap! a dissoc (uuid new))
             a)})



             :stream stream
             :peer local-peer})))

(declare client-state)

(defn add-transaction! [app-state tx]
  (s/assoc! (:stage client-state)
            [user ormap-id]
            (uuid tx)
            [['assoc tx]]))

(defn target-val [e]
  (.. e -target -value))
