diff --git a/src/common/datomish/js.cljs b/src/common/datomish/js.cljs index 2a9710e0..fccb8b55 100644 --- a/src/common/datomish/js.cljs +++ b/src/common/datomish/js.cljs @@ -75,13 +75,20 @@ (try (let [tx-data (js->tx-data tx-data)] (go-promise clj->js - (let [tx-result (js to-return)] + + ;; The tempids map isn't enough for a JS caller to look up one of + ;; these objects, so we need a lookup function. + (aset jsified "tempid" (fn [t] (get tempids t))) + jsified))) (catch js/Error e (println "Error in transact:" e)))) @@ -103,7 +110,11 @@ :q (fn [find opts] (q (d/db c) find opts)) :close (fn [] (db/close-db db)) + ;; So you can generate keywords for binding in `:inputs`. + :keyword keyword + ;; Some helpers for testing the bridge. + :println (fn [& xs] (apply println xs)) :equal = :idx (fn [tempid] (:idx tempid)) :cljify cljify