Fork me on GitHub
#pathom
<
2021-04-18
>
ribelo21:04:23

is there any magic way to extract a value from the map returned by eql if there is only one kv?

(-> (p.eql/process env {:db/id 1} [:name]) :name)
this way seems horribly suboptimal

wilkerlucio01:04:22

nothing native, but you can create a helper around that receives a single attr

👍 2
souenzzo12:04:06

(let [{:keys [name]} (p.eql/process env {:db/id 1} [:name])]
  name)

👍 1
ribelo21:04:14

when pulling one thing out, creating a smartmap seems even worse