 ;; ## First up Sente, define send-tx!, and hook up message handler router
 
 (defrecord DBFn [lang params code])
-(cljs.reader/register-tag-parser! 'db/fn map->DBFn)
+;(defn tagged-fn [:datsync.server/db-fn])
+(cljs.reader/register-tag-parser! 'db/fn pr-str)
 
 (let [packer (sente-transit/get-flexi-packer :edn)
       {:keys [chsk ch-recv send-fn state]}

;; Set up push message handler

; Dispatch on event key which is 1st elem in vector
(defmulti push-msg-handler
  (fn [[id _]] id))

(defmethod event-msg-handler :chsk/recv
  [{:as ev-msg :keys [?data]}]

(defn send-tx! [conn tx]
  (chsk-send! [:datsync.client/tx (datsync/datomic-tx conn tx)]))


(sente/start-chsk-router! ch-chsk event-msg-handler)


