hyperfiddle-2020
hyperfiddle-2020 copied to clipboard
hf/tx abstraction missing
This pattern keeps coming up, where the fiddle defn returns nil as it is simply a prompt that collects parameters for a transaction. Should the hf/tx be directly routable?
(defn ^::hf/fiddle alias-to [sub user] nil)
(defmethod hf/view-defaults `alias-to [sub user]
[sub (d/pull hf/*$* [:db/id] *suber-user*)]) ; for display
(defmethod hf/tx (keyword `alias-to) [ctx [e a v] props popover-ctx]
#?(:cljs
(let [[_ sub suber-user] @(:hypercrud.browser/route-defaults-symbolic popover-ctx)]
; Server resolves suber-user for security
[`(alias-me ~sub)])))