我当前正在使用以下两个代码块来访问ClojureScript中的嵌套值:
Level1
Level2
(def response (re-frame/subscribe [::subs/quote]))
(def body (:body @response))
(def value (:value body))
(println value)
是否有更好/更简洁的方法?谢谢。
答案 0 :(得分:2)
键可用作操作符来检索其值,如下所示:
(def lol (:value (:body @(re-frame/subscribe [::subs/quote]))))
(println lol)
但是,我更喜欢将函数用作get-in