         ;; ???: Do the perf implications of anonymous functions mean these
         ;; shouldn't be in a tight loop?
         fn-desc->rpc       (fn fn-desc->rpc [remote-name desc]
-                             (fn [& all-args]
-                               ;; TODO: Check if last argument is a channel, an
-                               (let [cb-or-ch (last all-args)
-                                     cb       (cond
-                                                (fn? cb-or-ch)   cb-or-ch
-                                                (chan? cb-or-ch) #(put! cb-or-ch %)
-                                                :else            false)
-                                     args     (if cb
-                                                (drop-last 1 all-args)
-                                                all-args)
-                                     uuid     (d/squuid)]
-                                 (when (fn? cb)
-                                   (swap! pending-rpc assoc uuid cb-or-ch))
-                                 (dato-send! remote-name {:args   args
-                                                          :rpc/id uuid})
-                                 (if (chan? cb-or-ch)
-                                   cb-or-ch
-                                   uuid))))]
+                             (let [f (fn [& all-args]
+                                       ;; TODO: Check if last argument is a channel, an
+                                       (let [cb-or-ch (last all-args)
+                                             cb       (cond
+                                                        (fn? cb-or-ch)   cb-or-ch
+                                                        (chan? cb-or-ch) #(put! cb-or-ch %)
+                                                        :else            false)
+                                             args     (if cb
+                                                        (drop-last 1 all-args)
+                                                        all-args)
+                                             uuid     (d/squuid)]
+                                         (when (fn? cb)
+                                           (swap! pending-rpc assoc uuid cb-or-ch))
+                                         (dato-send! remote-name {:args   args
+                                                                  :rpc/id uuid})
+                                         (if (chan? cb-or-ch)
+                                           cb-or-ch
+                                           uuid)))]
+                               f))]
     {:comms    comms
      ;; Just for debugging to simulate messages coming in from the
      ;; server

                                    (recur)))
                                (dato-send! :ss/bootstrap {})
                                (js/console.log "1. Bootstrap")
                                (let [{:keys [data] :as -bootstrap} (loop [msg (<! ws-ch)]
                                                                      (if (= :ss/bootstrap-succeeded (:event msg))
                                                                        msg
                                                                        ;; Not the
                                                                        ;; message
                                                                        ;; we're
                                                                        ;; looking for
                                                                        ;; (could be
                                                                        ;; something
                                                                        ;; during
                                                                        ;; refreshing
                                                                        ;; with
                                                                        ;; figwheel. Put
                                                                        ;; the message
                                                                        ;; back on,
                                                                        ;; wait a few
                                                                        ;; ms, and try
                                                                        ;; again. Still very racy.
                                                                        (do
                                                                          (put! ws-ch msg)
                                                                          (<! (async/timeout 16))
                                                                          (recur (<! ws-ch)))))
                                      _ (js/console.log "2. Bootstrap; " data)
                                      {:keys [session-id schema]}      data]
                                  (swap! ss-data merge (:ss data))
                                  (reset! ss-api (->> (:ss data)

  (get-in dato [:api :r-transact]) data)

(defn transact! [dato & args]
  (apply (get-in dato [:api :transact!]) args))

(defn cast! [dato event-data]
