瀏覽代碼

use ->> for better readability

sid597 2 年之前
父節點
當前提交
35badf5c52
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/main/frontend/extensions/code.cljs

+ 7 - 2
src/main/frontend/extensions/code.cljs

@@ -260,8 +260,13 @@
                 state)
    :did-update (fn [state]
                  (reset! (:code-options state) (last (:rum/args state)))
-                 (.setValue @(:editor-atom state)
-                            (string/join "" (butlast (:lines (last (:rum/args state))))))
+                 (->> state
+                      :rum/args
+                      last
+                      :lines
+                      butlast
+                      (string/join "")
+                      (.setValue @(:editor-atom state)))
                  state)}
   [state _config id attr code _theme _options]
   [:div.extensions__code