Преглед на файлове

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)
                 state)
    :did-update (fn [state]
    :did-update (fn [state]
                  (reset! (:code-options state) (last (:rum/args 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)}
   [state _config id attr code _theme _options]
   [state _config id attr code _theme _options]
   [:div.extensions__code
   [:div.extensions__code